xiaogang 3 년 전
부모
커밋
5f6f4d7f3e
1개의 변경된 파일5개의 추가작업 그리고 3개의 파일을 삭제
  1. 5 3
      app/Admin/Actions/Users/UsersInfoForm.php

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

xqd xqd
@@ -11,10 +11,12 @@ use PHPUnit\Util\Exception;
 class UsersInfoForm extends Form implements LazyRenderable
 {
     use LazyWidget;
+    private $user_info;
     public function __construct($data = [], $key = null)
     {
         parent::__construct($data, $key);
-
+        $this->user_info = UserInfoModel::query()->where('user_id',$this->payload['user_id'])->first();
+        $this->fill($this->user_info );
     }
 
     public function handle(array $input)
@@ -30,8 +32,8 @@ class UsersInfoForm extends Form implements LazyRenderable
 
     public function form()
     {
-        $user_info = UserInfoModel::query()->where('user_id',$this->payload['user_id'])->first();
-        $this->fill($user_info);
+//        $user_info = UserInfoModel::query()->where('user_id',$this->payload['user_id'])->first();
+//        $this->fill($user_info);
         $this->text('user_id',"用户ID")->readOnly();
         $this->text('nickname', '昵称')->required();
         $this->image('avatar', '头像')->saveFullUrl()->uniqueName()->removable(false);