From 458aea9c2af2316c2d1292af5b8235eb5a3df96c Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Thu, 5 Mar 2020 10:41:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=B5=84=E6=BA=90bug?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/Controller/TestResourceController.class.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Application/Home/Controller/TestResourceController.class.php b/Application/Home/Controller/TestResourceController.class.php index 76f345a74..c7bc90b12 100644 --- a/Application/Home/Controller/TestResourceController.class.php +++ b/Application/Home/Controller/TestResourceController.class.php @@ -360,6 +360,7 @@ class TestResourceController extends BaseController if (!empty($i_account)) { $user=M('user', 'tab_')->field('promote_id,password,phone')->where(['account'=>$i_account])->find(); $promote = $this->get_all_promote(); + if (!in_array($user['promote_id'], $promote)) { M('test_resource', 'tab_')->rollback();//回滚 $this->ajaxReturn(['msg'=>$i_account.'账号不存在' ,'status'=>0]); @@ -480,7 +481,9 @@ class TestResourceController extends BaseController } } else {//非新用户 - $availableBalance = getAvailableBalance($data['promote_id'],$data['game_id'],$data['server_name']); + $user_promote_id = M('user','tab_')->where(['id'=>$data['user_id']])->find()['promote_id']; + + $availableBalance = getAvailableBalance($user_promote_id,$data['game_id'],$data['server_name']); // var_dump($availableBalance);die(); $promoteAllRecharge = sum_promote_total_money($data['promote_id']);//总充值量 @@ -505,7 +508,7 @@ class TestResourceController extends BaseController $data['is_new'] = 2; M('promote_game_available_balance','tab_') - ->where(['promote_id'=>$data['promote_id'],'game_id'=>$data['game_id'],'server_name'=>$data['server_name']]) + ->where(['promote_id'=>$user_promote_id,'game_id'=>$data['game_id'],'server_name'=>$data['server_name']]) ->setDec('available_balance',$data['apply_resource']); }