seven 1 mese fa
parent
commit
d64f3b8e7b
1 ha cambiato i file con 24 aggiunte e 2 eliminazioni
  1. 24 2
      app/Services/BetService.php

+ 24 - 2
app/Services/BetService.php

@@ -413,6 +413,7 @@ class BetService extends BaseService
         $text = $issue_no."期开奖结果 \n";
         $text .= "-----本期开奖账单----- \n";
 
+        $bet_num = 0;
         foreach($list->toArray() as $k => $v){
             $item = [];
             $item['id'] = $v['id'];
@@ -424,7 +425,12 @@ class BetService extends BaseService
                     $profit = 880000; // 单注最高奖金880000
                 }
                 $item['profit'] = $profit;
-                $text .= "私聊下注 【******】 {$profit}\n";
+
+                $yl = $profit - $v['amount'];
+                if($k+1 <= 15){
+                    $text .= "私聊下注 【******】 {$yl}\n";
+                    $bet_num++;
+                }
                 // 结算
                 WalletService::updateBalance($v['member_id'],$profit);
 
@@ -433,12 +439,28 @@ class BetService extends BaseService
 
                 BalanceLogService::addLog($v['member_id'],$profit,$balance,($balance+$profit),'中奖',$v['id'],'');
             }else{
-                $text .= "私聊下注 【******】 -{$v['amount']}\n";
+                if($k+1 <= 15){
+                    $text .= "私聊下注 【******】 -{$v['amount']}\n";
+                    $bet_num++;
+                }
             }
 
             self::model()::where('id',$v['id'])->update($item);
         }
         $inlineButton = self::getOperateButton();
+
+        $rand_num = 30 - $bet_num;
+        for($i=0;$i<$rand_num;$i++){
+            // 生成 -100000 到 100000 的随机数,但排除 -10 到 10 的范围
+            $randomNumber = random_int(-100000, 100000);
+            if ($randomNumber >= -10 && $randomNumber <= 10) {
+                // 如果落在 -10 到 10 之间,重新生成或调整
+                $randomNumber = $randomNumber < 0 ? -random_int(10, 100000) : random_int(10, 100000);
+            }
+            $text .= "私聊下注 【******】 {$randomNumber}\n";
+        }
+
+         // 群通知
         self::bettingGroupNotice($text, $inlineButton, '');
     }
 }