Browse Source

奖金测试

lizhen_gitee 1 year ago
parent
commit
0f51dfd112
2 changed files with 14 additions and 7 deletions
  1. 6 6
      application/api/controller/Notify.php
  2. 8 1
      application/common/model/Wallet.php

+ 6 - 6
application/api/controller/Notify.php

@@ -100,15 +100,15 @@ class Notify extends Api
     public function test(){
 //        $this->takecash(5,10000,'take_cash',1);
 
-        $this->shouyi(1,10000,'user_match_audio_log',1);
+//        $this->shouyi(1,10000,'user_match_audio_log',1);
 //        $this->shouyi(2,10000,'user_match_audio_log',1);
 //        $this->shouyi(3,10000,'user_match_audio_log',1);
 
-//        $this->recharge(5,10000,'user_match_audio_log',1);
-//        $this->recharge(4,10000,'user_match_audio_log',1);
-//        $this->recharge(3,10000,'user_match_audio_log',1);
-//        $this->recharge(2,10000,'user_match_audio_log',1);
-//        $this->recharge(1,10000,'user_match_audio_log',1);
+//        $this->recharge(5,10000,'',1);
+//        $this->recharge(4,10000,'',1);
+//        $this->recharge(3,10000,'',1);
+//        $this->recharge(2,10000,'',1);
+//        $this->recharge(1,10000,'',1);
     }
 
     //普通邀请关系,提现

+ 8 - 1
application/common/model/Wallet.php

@@ -89,6 +89,9 @@ class Wallet extends Model
 
         //获取小数点
         $point = 1;
+        if($accountType == 'agentjewel'){
+            $point = 2;
+        }
         bcscale($point);
 
         //检测0
@@ -114,7 +117,7 @@ class Wallet extends Model
         }
 
         //扣除金币单独方法
-        if(bccomp($number, 0) === -1 && $accountType == 'gold'){
+        if($accountType == 'gold' && bccomp($number, 0) === -1){
             //两个钱包的合,是否足够
             $wallet_sum = bcadd($wallet['gold'],$wallet['jewel']);
             if(bccomp(bcadd($wallet_sum, $number), 0) === -1)
@@ -240,6 +243,10 @@ class Wallet extends Model
     private function wallet_do($user_id,$accountType,$data,$result){
 
         $log_table = 'user_gold_log';
+        if($accountType == 'agentjewel'){
+            $log_table = 'user_agentjewel_log';
+        }
+
         $rs2_id = Db::name($log_table)->insertGetId($data);
 
         //修改金额