| xqd
@@ -19,19 +19,11 @@ class UsersInfoForm extends Form implements LazyRenderable
|
|
|
|
|
|
public function handle(array $input)
|
|
|
{
|
|
|
- $user = User::query()->find($input['id']);
|
|
|
- if(!$user){
|
|
|
+ $user_info = UserInfoModel::query()->find($input['user_id']);
|
|
|
+ if(!$user_info){
|
|
|
return $this->response()->error('请刷新后重试');
|
|
|
}
|
|
|
- if($input['mobile']!=$user->mobile && User::query()->where('mobile',$input['mobile'])->first()){
|
|
|
- return $this->response()->error('该手机号码已被使用');
|
|
|
- }else{
|
|
|
- $user->mobile = $input['mobile'];
|
|
|
- }
|
|
|
- if($input['password']!=''){
|
|
|
- $user->password = $input['password'];
|
|
|
- }
|
|
|
- $user->save();
|
|
|
+ $user_info->update($input);
|
|
|
return $this->response()->success('保存成功')->refresh();
|
|
|
}
|
|
|
|