فهرست منبع

是否足够下一分钟

lizhen_gitee 10 ماه پیش
والد
کامیت
dba33737ba
1فایلهای تغییر یافته به همراه26 افزوده شده و 5 حذف شده
  1. 26 5
      application/api/controller/Match.php

+ 26 - 5
application/api/controller/Match.php

@@ -101,8 +101,15 @@ class Match extends Api
             //补贴给对方0.1金币
             $money = '0.1';
 
+            //下一分钟
             if($user_wallet['video_sec'] > 1){
                 $next_minute = 1;
+            }else{
+                //最后一分钟的情况,查询钱包
+                $goldtotal = model('wallet')->getWallettotal($this->auth->id);
+                if($goldtotal >= $to_user_info['match_video_price']){
+                    $next_minute = 1;
+                }
             }
         }else{
             $task_status = 1;
@@ -116,7 +123,7 @@ class Match extends Api
                 }
             }
 
-            if($goldtotal - $price > $price){
+            if($goldtotal - $price >= $price){
                 $next_minute = 1;
             }
         }
@@ -277,8 +284,15 @@ class Match extends Api
             //补贴给对方0.1金币
             $money = '0.1';
 
-            if($user_wallet['video_sec'] > 1){
+            //下一分钟
+            if($user_wallet['audio_sec'] > 1){
                 $next_minute = 1;
+            }else{
+                //最后一分钟的情况,查询钱包
+                $goldtotal = model('wallet')->getWallettotal($this->auth->id);
+                if($goldtotal >= $to_user_info['match_audio_price']){
+                    $next_minute = 1;
+                }
             }
         }else{
             $task_status = 1;
@@ -292,7 +306,7 @@ class Match extends Api
                 }
             }
 
-            if($goldtotal - $price > $price){
+            if($goldtotal - $price >= $price){
                 $next_minute = 1;
             }
         }
@@ -450,8 +464,15 @@ class Match extends Api
             //补贴给对方0.1金币
             $money = '0.1';
 
-            if($user_wallet['video_sec'] > 1){
+            //下一分钟
+            if($user_wallet['typing_times'] > 1){
                 $next_minute = 1;
+            }else{
+                //最后一分钟的情况,查询钱包
+                $goldtotal = model('wallet')->getWallettotal($this->auth->id);
+                if($goldtotal >= $to_user_info['match_typing_price']){
+                    $next_minute = 1;
+                }
             }
         }else{
             //需要扣别人的钱,判断钱是否购
@@ -464,7 +485,7 @@ class Match extends Api
                 }
             }
 
-            if($goldtotal - $price > $price){
+            if($goldtotal - $price >= $price){
                 $next_minute = 1;
             }
         }