xiaogang 3 vuotta sitten
vanhempi
commit
3b25378071

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

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

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

xqd xqd
@@ -11,12 +11,10 @@ use PHPUnit\Util\Exception;
 class UsersInfoForm extends Form implements LazyRenderable
 {
     use LazyWidget;
-    private $key;
+
     public function __construct($data = [], $key = null)
     {
         parent::__construct($data, $key);
-        $this->key = $key;
-
     }
 
     public function handle(array $input)
@@ -32,8 +30,7 @@ class UsersInfoForm extends Form implements LazyRenderable
 
     public function form()
     {
-//        $user_info = UserInfoModel::query()->where('user_id',$this->payload['user_id'])->first();
-        $user_info = UserInfoModel::query()->where('user_id',$this->key)->first();
+        $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();