feat(UserLogic): 添加用户船只参数验证
This commit is contained in:
parent
afd09bbb9b
commit
2b364dfa62
@ -78,6 +78,34 @@ class UserLogic extends BaseLogic
|
||||
|
||||
public static function StoreAdd(array $params)
|
||||
{
|
||||
$user_ship=$params['user_ship']??0;
|
||||
if($user_ship==2){
|
||||
if(!isset($params['village'])){
|
||||
self::setError('请设置村参数');
|
||||
return false;
|
||||
}
|
||||
$arr=User::where('user_ship',$user_ship)->column('id');
|
||||
if($arr){
|
||||
$find=UserAddress::where('uid','in',$arr)->where('village',$params['village'])->find();
|
||||
if($find){
|
||||
self::setError('该区域又有村长请重新选择');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}elseif($user_ship==3){
|
||||
if(!isset($params['brigade'])){
|
||||
self::setError('请设置队参数');
|
||||
return false;
|
||||
}
|
||||
$arr=User::where('user_ship',$user_ship)->column('id');
|
||||
if($arr){
|
||||
$find=UserAddress::where('uid','in',$arr)->where('village',$params['village'])->where('brigade',$params['brigade'])->find();
|
||||
if($find){
|
||||
self::setError('该区域已有队长请重新选择');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
$passwordSalt = Config::get('project.unique_identification');
|
||||
$password = create_password(123456, $passwordSalt);
|
||||
$defaultAvatar = config('project.default_image.admin_avatar');
|
||||
|
Loading…
x
Reference in New Issue
Block a user