diff --git a/Application/Home/Controller/TestResourceController.class.php b/Application/Home/Controller/TestResourceController.class.php index 2febe1a97..d7d9e865e 100644 --- a/Application/Home/Controller/TestResourceController.class.php +++ b/Application/Home/Controller/TestResourceController.class.php @@ -428,7 +428,7 @@ class TestResourceController extends BaseController $data['create_time']=time(); $data['apply_type']=0; - $data = $this->checkAutoVerify($data, $resource); + $data = $this->checkAutoVerify($data, $resource, $i); $model = M('test_resource', 'tab_')->add($data); $resource += $data['apply_resource']; if ($model) { @@ -455,8 +455,11 @@ class TestResourceController extends BaseController /** *判断申请资源是否自动审核 + * @param $data array 新增数据 + * @param $resource int 此次已申请资源 + * @param $thisCount int 批量申请的第几次 */ - private function checkAutoVerify($data, $resource = 0) + private function checkAutoVerify($data, $resource = 0, $thisCount = 0) { $config = M('resource_verify_config', 'tab_') ->where(['game_id' => $data['game_id'], 'status' => 1]) @@ -465,6 +468,7 @@ class TestResourceController extends BaseController $count = M('test_resource', 'tab_') ->where(['user_id' => $data['user_id'], 'game_id' => $data['game_id']]) ->count(); + $count += $thisCount; if ($count < $config['new_apply_count']) {//新用户 //申请资源数量在最低额度和最高额度之间,自动审核 if ($data['apply_resource'] >= $config['new_low_value'] && $data['apply_resource'] <= $config['new_high_value']) { @@ -595,7 +599,7 @@ class TestResourceController extends BaseController $data['create_time']=time(); $data['apply_type']=1; - $data = $this->checkAutoVerify($data, $resource); + $data = $this->checkAutoVerify($data, $resource, $key); $model = M('test_resource','tab_')->add($data); $resource += $data['apply_resource']; if($model===false){