|
@@ -628,14 +628,17 @@ class UserController
|
|
|
['address'],
|
|
['address'],
|
|
|
]);
|
|
]);
|
|
|
if (!$data['type']) return app('json')->fail('传入type');
|
|
if (!$data['type']) return app('json')->fail('传入type');
|
|
|
|
|
+ $apply = UserApply::where('status', 0)->find();
|
|
|
|
|
+ if ($apply) return app('json')->fail('已提交申请,请耐心等待审核');
|
|
|
if ($data['type'] == 2){
|
|
if ($data['type'] == 2){
|
|
|
- $user = User::where('proxy_area', 'like', '%'.$data['address'].'%')->find();
|
|
|
|
|
|
|
+ $user = User::where('proxy_area', 'like', '%'.$data['address'].'%')->where('status', '>=', 0)->find();
|
|
|
if ($user) return app('json')->fail('该地址已被申请');
|
|
if ($user) return app('json')->fail('该地址已被申请');
|
|
|
if (!$data['address']) return app('json')->fail('填写申请地址');
|
|
if (!$data['address']) return app('json')->fail('填写申请地址');
|
|
|
}
|
|
}
|
|
|
$user = User::where('uid', $request->uid())->find();
|
|
$user = User::where('uid', $request->uid())->find();
|
|
|
if ($user['identity'] == 2) return app('json')->fail('已是区域代理');
|
|
if ($user['identity'] == 2) return app('json')->fail('已是区域代理');
|
|
|
if ($user['identity'] == 1 and $data['type'] == 1) return app('json')->fail('已是vip代理');
|
|
if ($user['identity'] == 1 and $data['type'] == 1) return app('json')->fail('已是vip代理');
|
|
|
|
|
+ if ($data['type'] == 1) $data['address'] = [];
|
|
|
$res = UserApply::create([
|
|
$res = UserApply::create([
|
|
|
'uid' => $request->uid(),
|
|
'uid' => $request->uid(),
|
|
|
'type' => $data['type'],
|
|
'type' => $data['type'],
|