|
|
@ -646,6 +646,11 @@ class User extends BaseController |
|
|
|
return app('json')->fail('不能选自己'); |
|
|
|
return app('json')->fail('不能选自己'); |
|
|
|
if ($spid && !$this->repository->exists($spid)) |
|
|
|
if ($spid && !$this->repository->exists($spid)) |
|
|
|
return app('json')->fail('推荐人不存在'); |
|
|
|
return app('json')->fail('推荐人不存在'); |
|
|
|
|
|
|
|
$spreadUser = $this->repository->get($spid); |
|
|
|
|
|
|
|
if($spreadUser['spread_uid'] == $id){ |
|
|
|
|
|
|
|
return app('json')->fail('不能设置相互推荐'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$this->repository->changeSpread($id, $spid, $this->request->adminId()); |
|
|
|
$this->repository->changeSpread($id, $spid, $this->request->adminId()); |
|
|
|
return app('json')->success('修改成功'); |
|
|
|
return app('json')->success('修改成功'); |
|
|
|
} |
|
|
|
} |
|
|
|