推广后台-》测试资源申请-》符合规则的自动审核

master
liuweiwen 5 years ago
parent aa8d296dd8
commit 47cdce733c

@ -456,20 +456,20 @@ class TestResourceController extends BaseController
private function checkAutoVerify($data) private function checkAutoVerify($data)
{ {
$config = M('resource_verify_config', 'tab_') $config = M('resource_verify_config', 'tab_')
->where(['game_id' => $data['game_id']]) ->where(['game_id' => $data['game_id'], 'status' => 1])
->find(); ->find();
if ($config) {//已存在该游戏的资源审核配置 if ($config) {//已存在该游戏的资源审核配置
$isOldUser = M('test_resource', 'tab_') $count = M('test_resource', 'tab_')
->where(['user_id' => $data['user_id']]) ->where(['user_id' => $data['user_id']])
->count(); ->count();
if (!$isOldUser) {//未申请过测试资源的新用户 if ($count <= $config['new_apply_count']) {//新用户
//申请资源数量在最低额度和最高额度之间,自动审核 //申请资源数量在最低额度和最高额度之间,自动审核
if ($data['apply_resource'] >= $config['new_low_value'] && $data['apply_resource'] <= $config['new_high_value']) { if ($data['apply_resource'] >= $config['new_low_value'] && $data['apply_resource'] <= $config['new_high_value']) {
$data['verify_remark'] = '自动审核'; $data['verify_remark'] = '自动审核';
$data['verify_time'] = time(); $data['verify_time'] = time();
$data['apply_status'] = 2; $data['apply_status'] = 2;
} }
} else {//已申请过测试资源(非新用户 } else {//非新用户
$promoteAllRecharge = sum_promote_total_money($data['promote_id']);//总充值量 $promoteAllRecharge = sum_promote_total_money($data['promote_id']);//总充值量
$autoVerifyValue = $promoteAllRecharge * $config['old_value_ratio']; $autoVerifyValue = $promoteAllRecharge * $config['old_value_ratio'];
if ($data['apply_resource'] <= $autoVerifyValue) { if ($data['apply_resource'] <= $autoVerifyValue) {

Loading…
Cancel
Save