|
|
@@ -526,19 +526,53 @@ class BetService extends BaseService
|
|
|
$inlineButton = self::getOperateButton();
|
|
|
|
|
|
$rand_num = 30 - $bet_num;
|
|
|
- for ($i = 0; $i < $rand_num; $i++) {
|
|
|
- // 生成 -100000 到 100000 的随机数,但排除 -10 到 10 的范围
|
|
|
- $randomNumber = random_int(-1000000, 1000000) / 100;
|
|
|
- if ($randomNumber >= -10 && $randomNumber <= 10) {
|
|
|
- // 如果落在 -10 到 10 之间,重新生成或调整
|
|
|
- $randomNumber = $randomNumber < 0 ? -random_int(10, 100000) : random_int(10, 100000);
|
|
|
- }
|
|
|
- $text .= "私聊下注 【******】 {$randomNumber}\n";
|
|
|
- }
|
|
|
+ $text .= self::fakeLotteryDraw($issue_no, $awards, $rand_num);
|
|
|
+ // for ($i = 0; $i < $rand_num; $i++) {
|
|
|
+ // // 生成 -100000 到 100000 的随机数,但排除 -10 到 10 的范围
|
|
|
+ // $randomNumber = random_int(-1000000, 1000000) / 100;
|
|
|
+ // 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, '');
|
|
|
}
|
|
|
|
|
|
|
|
|
+ // 虚拟开奖
|
|
|
+ public static function fakeLotteryDraw($issue_no,$awards,$rand_num = 30)
|
|
|
+ {
|
|
|
+
|
|
|
+ $fake_bet_list = Cache::get('fake_bet_'.$issue_no,[]);
|
|
|
+ $text = "";
|
|
|
+
|
|
|
+ foreach($fake_bet_list as $k => $v){
|
|
|
+ $lastStr = self::getLastChar($v['first_name'],1);
|
|
|
+ if(in_array($v['keywords'],$awards)){
|
|
|
+ $profit = $v['amount'] * $v['odds'];
|
|
|
+ if($profit > 880000){
|
|
|
+ $profit = 880000; // 单注最高奖金880000
|
|
|
+ }
|
|
|
+ $item['profit'] = $profit;
|
|
|
+
|
|
|
+ $yl = $profit - $v['amount'];
|
|
|
+ if($k+1 <= $rand_num){
|
|
|
+ $text .= "私聊下注 【******".$lastStr."】 {$yl}\n";
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ if($k+1 <= $rand_num){
|
|
|
+ $text .= "私聊下注 【******".$lastStr."】 -{$v['amount']}\n";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ return $text;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|