xiaogang 3 lat temu
rodzic
commit
96d3f6bced

+ 1 - 1
app/Admin/Actions/Users/SetUserInfo.php

xqd
@@ -58,7 +58,7 @@ class SetUserInfo extends RowAction
 
     public function render()
     {
-        $form = UsersInfoForm::make(UserInfoModel::query()->where('user_id',$this->getKey())->first());
+        $form = UsersInfoForm::make(new UserInfoModel(),$this->getKey());
         return Modal::make()
             ->lg()
             ->title($this->title)

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

xqd xqd
@@ -12,11 +12,10 @@ class UsersInfoForm extends Form implements LazyRenderable
 {
     use LazyWidget;
 
-    private $model;
+
     public function __construct($data = [], $key = null)
     {
         parent::__construct($data, $key);
-        $this->model=$data;
     }
 
     public function handle(array $input)
@@ -44,7 +43,6 @@ class UsersInfoForm extends Form implements LazyRenderable
     {
         //$user_info = UserInfoModel::query()->where('user_id',$this->payload['id'])->first();
         //dd($this->model());
-        $this->fill($this->model);
         $this->text('user_id');//->value($this->payload['id'])->readOnly();
         $this->text('nickname', '昵称');//->value($user_info->nickname);
         $this->image('avatar', '头像');//->url($user_info->avatar);