更新头像添加路径3
This commit is contained in:
@@ -198,13 +198,12 @@ function getPicUrl($url)
|
|||||||
} else {
|
} else {
|
||||||
unset($params['password'], $params['salt']);
|
unset($params['password'], $params['salt']);
|
||||||
}
|
}
|
||||||
|
//这里需要针对mobile做唯一验证1111
|
||||||
$params['avatar'] = $this->getPicUrl($params['avatar']);
|
|
||||||
//这里需要针对mobile做唯一验证
|
|
||||||
$adminValidate = \think\Loader::validate('Student');
|
$adminValidate = \think\Loader::validate('Student');
|
||||||
$adminValidate->rule([
|
$adminValidate->rule([
|
||||||
'mobile' => 'regex:1[3-9]\d{9}|unique:student,mobile,' . $row->id,
|
'mobile' => 'regex:1[3-9]\d{9}|unique:student,mobile,' . $row->id,
|
||||||
]);
|
]);
|
||||||
|
$params['avatar'] = $this->getPicUrl($params['avatar']);
|
||||||
$result = $row->validateFailException()->validate('Student.edit')->allowField(true)->save($params);
|
$result = $row->validateFailException()->validate('Student.edit')->allowField(true)->save($params);
|
||||||
Db::commit();
|
Db::commit();
|
||||||
} catch (ValidateException|PDOException|Exception $e) {
|
} catch (ValidateException|PDOException|Exception $e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user