xiaogang 4 years ago
parent
commit
75e886b18a
1 changed files with 3 additions and 11 deletions
  1. 3 11
      app/Admin/Actions/Users/UsersInfoForm.php

+ 3 - 11
app/Admin/Actions/Users/UsersInfoForm.php

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();
     }