浏览代码

Merge branch 'master' of http://47.76.126.2:3000/seven/bot-28

Ken 2 周之前
父节点
当前提交
2a70a67ce3
共有 3 个文件被更改,包括 40 次插入13 次删除
  1. 0 8
      app/Jobs/FiveSecondTaskJob.php
  2. 36 5
      app/Services/BetService.php
  3. 4 0
      app/Services/IssueService.php

+ 0 - 8
app/Jobs/FiveSecondTaskJob.php

@@ -1,12 +1,4 @@
 <?php
-/*
- * @Author: seven 7@seven.com
- * @Date: 2025-10-09 17:31:51
- * @LastEditors: seven 7@seven.com
- * @LastEditTime: 2025-11-05 11:37:34
- * @FilePath: \bot-28\app\Jobs\FiveSecondTaskJob.php
- * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
- */
 
 namespace App\Jobs;
 

+ 36 - 5
app/Services/BetService.php

@@ -1140,6 +1140,41 @@ class BetService extends BaseService
 
         // 群通知
         // self::bettingGroupNotice($text, $inlineButton, '');
+        
+
+        SendTelegramGroupMessageJob::dispatch($text, $inlineButton, '');
+
+
+    }
+
+    /**
+     * @description: 统计投注情况通知
+     * @param {*} $issue_no
+     * @return {*}
+     */    
+    public static function statNotice($issue_no)
+    {
+        $keywordsList = [];
+        // 虚拟投注情况
+        $fake_bet_list = Cache::get('fake_bet_' . $issue_no, []);
+        foreach($fake_bet_list as $k => $v){
+            if(isset($keywordsList[$v['keywords']])){
+                $keywordsList[$v['keywords']] += $v['amount'];
+            }else{
+                $keywordsList[$v['keywords']] = $v['amount'];
+            }
+        }
+
+        // 真实投注
+        $list = self::findAll(['issue_no' => $issue_no, 'status' => self::model()::STATUS_STAY]);
+        foreach($list->toArray() as $k => $v){
+            if(isset($keywordsList[$v['keywords']])){
+                $keywordsList[$v['keywords']] += $v['amount'];
+            }else{
+                $keywordsList[$v['keywords']] = $v['amount'];
+            }
+        }
+
         $text3 = "📝 {$issue_no}期投注统计 \n";
 
         if($keywordsList){
@@ -1150,12 +1185,8 @@ class BetService extends BaseService
                 $text3 .= "-------------- \n";
             }
         }
-
+        $inlineButton = self::getOperateButton();
         SendTelegramGroupMessageJob::dispatch($text3, $inlineButton, '');
-
-        SendTelegramGroupMessageJob::dispatch($text, $inlineButton, '');
-
-
     }
 
 

+ 4 - 0
app/Services/IssueService.php

@@ -227,6 +227,10 @@ class IssueService extends BaseService
             // self::bettingGroupNotice($text, $buttons, $image);
             self::asyncBettingGroupNotice($text, $buttons, $image);
         }
+
+        // 投注情况通知
+        BetService::statNotice($info->issue_no);
+
         return ['code' => self::YES, 'msg' => '封盘成功'];
     }