Ken 5 дней назад
Родитель
Сommit
3f06c07be1
1 измененных файлов с 15 добавлено и 18 удалено
  1. 15 18
      app/Services/BetService.php

+ 15 - 18
app/Services/BetService.php

@@ -193,17 +193,14 @@ class BetService extends BaseService
             $sumAmount = 0;
             $groupTexts = [];
 
-            $groupText  = "";
+            $groupText = "";
 
 
-
-
-
-            foreach ($betResult as $index =>$item) {
+            foreach ($betResult as $index => $item) {
                 $keywords = $item['rule'];
                 $amount = $item['amount'];
                 $error = $issueNo = "";
-                $b = static::singleNote($memberId, $keywords, $amount, $issueNo, $text, $error, $groupText,$index);
+                $b = static::singleNote($memberId, $keywords, $amount, $issueNo, $text, $error, $groupText, $index);
                 if ($b) {
                     $sumAmount += $amount;
                     $text = str_replace("{issue_no}", $issueNo, $text);
@@ -234,7 +231,7 @@ class BetService extends BaseService
 
             // 群通知
             $inlineButton = self::getOperateButton();
-            $groupText.="\n--------\n";
+            $groupText .= "\n--------\n";
             self::asyncBettingGroupNotice($groupText, $inlineButton);   // 异步群通知
             DB::commit();
         } catch (Exception $e) {
@@ -253,7 +250,7 @@ class BetService extends BaseService
         return $msg;
     }
 
-    private static function singleNote($memberId, $keywords, $amount, &$issueNo, &$text, &$errText, &$groupText,$index): bool
+    private static function singleNote($memberId, $keywords, $amount, &$issueNo, &$text, &$errText, &$groupText, $index): bool
     {
         $errText .= "【{$keywords}{$amount}】\n";
         //客服号
@@ -383,15 +380,15 @@ class BetService extends BaseService
         $lang = App::getLocale();
         $group_language = Config::where('field', 'group_language')->first()->val;
         App::setLocale($group_language);
-        if($index ===0){
+        if ($index === 0) {
             $groupText .= lang("第") . "{$issueNo}" . lang("期") . "\n";
             $groupText .= lang("开奖时间") . ":" . date("H:i:s", strtotime($issueInfo['end_time'])) . "\n";
             $groupText .= lang('投注截止') . ":" . date("H:i:s", (strtotime($issueInfo['end_time'])) - 30) . "\n";;
-            $groupText.=lang("成功")."\n";
+            $groupText .= lang("成功") . "\n";
             $groupText .= lang('玩家') . ": 【{$lastStr}】 \n";
-            $groupText .= "{$keywords} {$amount} ({$gameplayRuleInfo['odds']}".lang("倍率").") ";
-        }else{
-            $groupText .= "{$keywords} {$amount} ({$gameplayRuleInfo['odds']}".lang("倍率").") ";
+            $groupText .= "{$keywords} {$amount} ({$gameplayRuleInfo['odds']}" . lang("倍率") . ") ";
+        } else {
+            $groupText .= "{$keywords} {$amount} ({$gameplayRuleInfo['odds']}" . lang("倍率") . ") ";
         }
 
         App::setLocale($lang);
@@ -464,7 +461,7 @@ class BetService extends BaseService
                     $groupText = lang("第") . "{$issueInfo->issue_no}" . lang("期") . "\n";
                     $groupText .= lang("开奖时间") . ":" . date("H:i:s", strtotime($issueInfo['end_time'])) . "\n";
                     $groupText .= lang('投注截止') . ":" . date("H:i:s", (strtotime($issueInfo['end_time'])) - 30) . "\n";;
-                    $groupText.=lang("成功")."\n";
+                    $groupText .= lang("成功") . "\n";
                     $groupText .= lang('玩家') . ": 【{$lastStr}】 \n";
                     App::setLocale($lang);
 
@@ -505,7 +502,7 @@ class BetService extends BaseService
 
                             $fake_bet_list[] = $item;
 
-                            $groupText .= "{$input} ({$item['odds']}".lang("倍率").") ";
+                            $groupText .= "{$input} ({$item['odds']}" . lang("倍率") . ") ";
 
 
                             if (strtotime($issueInfo['end_time']) - strtotime($now_date) < 22) {
@@ -514,7 +511,7 @@ class BetService extends BaseService
                             }
                         }
                     }
-                    if($groupText!=""){
+                    if ($groupText != "") {
                         $groupText .= "\n-------- \n";
                         $inlineButton = self::getOperateButton();
                         // 群通知  暂停2秒再发送,避免同时发送多个消息而超过 Telegram 的频率限制
@@ -999,8 +996,8 @@ class BetService extends BaseService
         $text = "{$issue_no} " . lang("期开奖结果");
         $text .= "\n-----" . lang("本期开奖账单") . "----- \n";
         App::setLocale($lang);
-        $m= new Message();
-        $m->json = json_encode(['aaaaaaaaaaaaaaaaa'=>'openList','openList'=>$openList]);
+        $m = new Message();
+        $m->json = json_encode(['aaaaaaaaaaaaaaaaa' => 'openList', 'openList' => $openList]);
         $m->save();
         foreach ($openList as $k => $v) {