Browse Source

语音,视频,私聊免费的部分不上供

lizhen_gitee 1 year ago
parent
commit
57c9398272
3 changed files with 23 additions and 15 deletions
  1. 8 5
      app/Jobs/AudioJob.php
  2. 7 5
      app/Jobs/TypingJob.php
  3. 8 5
      app/Jobs/VideoJob.php

+ 8 - 5
app/Jobs/AudioJob.php

@@ -67,11 +67,14 @@ class AudioJob implements ShouldQueue
 
         DB::beginTransaction();
 
-        $Alltools = new Alltools;
-        $result = $Alltools->shouyi($data->to_user_id,$data->money,'user_match_audio_log',$this->msgid);
-        if($result !== true){
-            DB::rollBack();
-            return false;
+        $gold = bcsub($data->money,$data->free_money,1);
+        if($gold > 0){
+            $Alltools = new Alltools;
+            $result = $Alltools->shouyi($data->to_user_id,$gold,'user_match_audio_log',$this->msgid);
+            if($result !== true){
+                DB::rollBack();
+                return false;
+            }
         }
 
         //

+ 7 - 5
app/Jobs/TypingJob.php

@@ -67,11 +67,13 @@ class TypingJob implements ShouldQueue
 
         DB::beginTransaction();
 
-        $Alltools = new Alltools;
-        $result = $Alltools->shouyi($data->to_user_id,$data->money,'user_match_typing_log',$this->msgid);
-        if($result !== true){
-            DB::rollBack();
-            return false;
+        if($data->is_free == 0 && $data->money > 0){
+            $Alltools = new Alltools;
+            $result = $Alltools->shouyi($data->to_user_id,$data->money,'user_match_typing_log',$this->msgid);
+            if($result !== true){
+                DB::rollBack();
+                return false;
+            }
         }
 
         //

+ 8 - 5
app/Jobs/VideoJob.php

@@ -67,11 +67,14 @@ class VideoJob implements ShouldQueue
 
         DB::beginTransaction();
 
-        $Alltools = new Alltools;
-        $result = $Alltools->shouyi($data->to_user_id,$data->money,'user_match_video_log',$this->msgid);
-        if($result !== true){
-            DB::rollBack();
-            return false;
+        $gold = bcsub($data->money,$data->free_money,1);
+        if($gold > 0){
+            $Alltools = new Alltools;
+            $result = $Alltools->shouyi($data->to_user_id,$gold,'user_match_video_log',$this->msgid);
+            if($result !== true){
+                DB::rollBack();
+                return false;
+            }
         }
 
         //