tping 3 years ago
parent eecc1b0384
commit 85b024045c

@ -991,7 +991,7 @@ class UserController extends BaseController
$this->reg_data($user, 2);
}
private function register_check($data) {
public function register_check($data) {
if (!isset($data['promote_id']) || !$data['promote_id']) {
return true;
}
@ -1012,25 +1012,28 @@ class UserController extends BaseController
'promote_id' => $data['promote_id']
])->find();
if ($promoteRule && !$promoteRule['base_game_id']) {
throw new \Exception("推广员违规,请更换推广员");
throw new \Exception("推广员违规,请更换推广员1");
}
if ($promoteRule && $promoteRule['base_game_id'] == $baseGame['id']) {
throw new \Exception("推广员违规,请更换推广员");
throw new \Exception("推广员违规,请更换推广员2");
}
// 推广员链
//$promote['chain'] = '/1032/10099/10118/';
$promoteChain = explode('/', $promote['chain']);
// $promoteStr = implode(',', $promoteChain);
$promoteChain = array_filter($promoteChain);
if (!$promoteChain) {
return true;
}
$promoteStr = implode(',', $promoteChain);
$promoteRules = M('promote_limit_rules', 'tab_')->where([
'in' => ['promote_id', $promoteChain]
'promote_id' => ['in', $promoteStr]
])->select();
foreach ($promoteRules as $promoteRule) {
if ($promoteRule['base_game_id'] == 0 && $promoteRule['with_sub'] == 1) {
throw new \Exception("推广员违规,请更换推广员");
throw new \Exception("推广员违规,请更换推广员3");
}
if ($promoteRule['base_game_id'] == $baseGame['id'] && $promoteRule['with_sub'] == 1) {
throw new \Exception("推广员违规,请更换推广员");
throw new \Exception("推广员违规,请更换推广员4");
}
}

Loading…
Cancel
Save