/** * 更新 */ public function u($rq = NULL) { $this->guarded = arr_except_vals($this->guarded, ['password']); if (!$rq) { $rq = rq(); } return parent::u($rq); }
/** * 更新 */ public function u($rq = null) { $this->guarded = arr_except_vals($this->guarded, ['password']); if (!$rq) { $rq = rq(); } if (isset($rq['password'])) { $rq['password'] = hash_password($rq['password']); } return parent::u($rq); }
/** * 更新 */ public function u($rq = NULL) { // 代理只能修改自己 if (he_is('agency')) { if (rq('id') != uid()) { abort(403); } } $this->guarded = arr_except_vals($this->guarded, ['password']); if (!$rq) { $rq = rq(); } if (isset($rq['ended_at']) && $rq['ended_at'] == 'Invalid date') { unset($rq['ended_at']); } if (isset($rq['started_at']) && $rq['started_at'] == 'Invalid date') { unset($rq['started_at']); } return parent::u($rq); }