Ken 1 天之前
父节点
当前提交
a339a2d0bf
共有 2 个文件被更改,包括 5 次插入13 次删除
  1. 1 8
      app/Services/IssueService.php
  2. 4 5
      app/Services/PcIssueService.php

+ 1 - 8
app/Services/IssueService.php

@@ -833,15 +833,8 @@ class IssueService extends BaseService
                 $key = 'lottery_numbers_' . $v->issue_no;
                 $combo = implode(' ', $combo);
                 if (Cache::add($key, $winning_numbers, 100)) {
-                    $res = self::lotteryDraw($v->id, $winning_numbers, $combo, '');
-                    if ($res['code'] == self::NOT) {
-                        Log::error("开奖失败:{$v->issue_no}   {$res['meg']} ");
-                    }
-                    throw new \Exception('开奖失败', '1111');
+                    self::lotteryDraw($v->id, $winning_numbers, $combo, '');
                     $new = false;
-                } else {
-                    Log::error("开奖失败:{$v->issue_no}   1111111111111 ");
-                    throw new \Exception('开奖失败', '12222');
                 }
 
                 // Log::error('开奖缓存: ' .$key);

+ 4 - 5
app/Services/PcIssueService.php

@@ -226,8 +226,7 @@ class PcIssueService extends BaseService
                 'start_time' => $issue->end_time,
                 'end_time' => date('Y-m-d H:i:s', $end_time),
             ]);
-            $pc28Switch = Config::where('field', 'pc28_switch')->first()->val;
-            if ($pc28Switch == 1) static::betTing($new_str);
+            static::betTing($new_str);
             //预测
             PcPrediction::prediction($new_str);
             if (strtotime($issue->end_time) <= $now) {
@@ -249,7 +248,7 @@ class PcIssueService extends BaseService
         if (!in_array($info->status, [PcIssue::STATUS_DRAFT, PcIssue::STATUS_BETTING])) {
             return ['code' => self::NOT, 'msg' => '期号状态不正确'];
         }
-
+        $pc28Switch = Config::where('field', 'pc28_switch')->first()->val;
         $info->status = PcIssue::STATUS_BETTING;
         $info->save();
         $replyInfo = KeyboardService::findOne(['button' => '玩法规则']);
@@ -263,7 +262,7 @@ class PcIssueService extends BaseService
             if (empty($buttons)) {
                 $buttons = self::getOperateButton();
             }
-            self::asyncBettingGroupNotice($text, $buttons, $image);
+            if ($pc28Switch == 1) self::asyncBettingGroupNotice($text, $buttons, $image);
         }
 
         $replyInfo = KeyboardService::findOne(['button' => '开始下注']);
@@ -274,7 +273,7 @@ class PcIssueService extends BaseService
             if ($image) {
                 $image = url($image);
             }
-            self::asyncBettingGroupNotice($text, $buttons, $image);
+            if ($pc28Switch == 1) self::asyncBettingGroupNotice($text, $buttons, $image);
         }
 
         return ['code' => self::YES, 'msg' => '开始下注'];