From 85b024045c03c35ef162e0c73dc3ebf76a6c6054 Mon Sep 17 00:00:00 2001 From: tping Date: Wed, 22 Dec 2021 17:02:06 +0800 Subject: [PATCH] 1 --- .../Sdk/Controller/UserController.class.php | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/Application/Sdk/Controller/UserController.class.php b/Application/Sdk/Controller/UserController.class.php index f537682e..197070f4 100644 --- a/Application/Sdk/Controller/UserController.class.php +++ b/Application/Sdk/Controller/UserController.class.php @@ -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"); } }