xiaogang 3 年 前
コミット
ae6c333df0
1 ファイル変更5 行追加4 行削除
  1. 5 4
      app/Admin/Actions/Users/UsersInfoForm.php

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

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