main
fengxinyhyl 5 months ago
parent 4d9cdbb117
commit 71ceb4a182
  1. 5
      app/common/repositories/user/UserAssetsLogRepository.php
  2. 5
      app/controller/admin/user/User.php

@ -460,7 +460,12 @@ class UserAssetsLogRepository extends BaseRepository
}
// 查找第一个项目经理
$count = 0;
while (!$userProject) {
$count++;
if ($count > 20) {
return 0;
}
$user = $userRepository->get($user['spread_uid']);
if (empty($user)) {
return 0;

@ -646,6 +646,11 @@ class User extends BaseController
return app('json')->fail('不能选自己');
if ($spid && !$this->repository->exists($spid))
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());
return app('json')->success('修改成功');
}

Loading…
Cancel
Save