| xqd
@@ -11,11 +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 = $data;
|
|
|
}
|
|
|
|
|
|
public function handle(array $input)
|
| xqd
@@ -31,7 +32,6 @@ class UsersInfoForm extends Form implements LazyRenderable
|
|
|
}
|
|
|
if($input['password']!=''){
|
|
|
$user->password = $input['password'];
|
|
|
-
|
|
|
}
|
|
|
$user->save();
|
|
|
return $this->response()->success('保存成功')->refresh();
|
| xqd
@@ -41,10 +41,10 @@ class UsersInfoForm extends Form implements LazyRenderable
|
|
|
public function form()
|
|
|
{
|
|
|
//$user_info = UserInfoModel::query()->where('user_id',$this->payload['id'])->first();
|
|
|
- dd($this->data());
|
|
|
- $this->text('user_id');//->value($this->payload['id'])->readOnly();
|
|
|
- $this->text('nickname', '昵称');//->value($user_info->nickname);
|
|
|
- $this->image('avatar', '头像');//->url($user_info->avatar);
|
|
|
+ //dd($this->data());
|
|
|
+ $this->text('user_id')->value($this->user_info->user_id)->readOnly();
|
|
|
+ $this->text('nickname', '昵称')->value($this->user_info->nickname);
|
|
|
+ $this->image('avatar', '头像')->view($this->user_info->avatar);
|
|
|
|
|
|
}
|
|
|
}
|