| xqd
@@ -110,21 +110,18 @@ class UserController extends AdminController
|
|
|
$form = new Form(new User());
|
|
|
$form->display('id');
|
|
|
$form->text('mobile','手机号')->required();
|
|
|
- $form->text('pid','上级ID');
|
|
|
+ $form->text('pid','上级ID')->default(0);
|
|
|
|
|
|
$form->radio('sex','性别')->options([1=>'男',2=>'女'])->default(1);
|
|
|
$form->radio('is_vip','是否是VIP')->options([0=>'否',1=>'是'])->default(0);
|
|
|
$form->radio('is_auth','是否认证')->options([0=>'未认证',1=>'真人认证',2=>'女神认证'])->default(1);
|
|
|
- //$form->text('ycode','邀请码');
|
|
|
$form->text('city','所在城市')->default("成都市");
|
|
|
$form->radio('online','在线状态')->options([0=>'离线',1=>'在线'])->default(1);
|
|
|
-
|
|
|
$form->switch('status','状态')->default(1);
|
|
|
$form->saving(function ($res){
|
|
|
- dd($res->mobile);
|
|
|
- });
|
|
|
- $form->saved(function ($res){
|
|
|
- dd($res->model());
|
|
|
+ if(User::query()->where('mobile',$res->mobile)->first()){
|
|
|
+ return $res->error("手机号已存在");
|
|
|
+ }
|
|
|
});
|
|
|
return $form;
|
|
|
}
|