|
|
@@ -287,6 +287,50 @@ class IssueService extends BaseService
|
|
|
}
|
|
|
|
|
|
|
|
|
+ // 虚拟开奖
|
|
|
+ public static function fakeLotteryDraw()
|
|
|
+ {
|
|
|
+ // 期数验证
|
|
|
+ $issueInfo = IssueService::model()::where('status',IssueService::model()::STATUS_BETTING)->orderBy('id','desc')->first();
|
|
|
+ if($issueInfo){
|
|
|
+ $fake_bet_list = Cache::get('fake_bet_'.$issueInfo->issue_no,[]);
|
|
|
+ $winning_numbers = '5,6,2';
|
|
|
+ // 计算中奖
|
|
|
+ $awards = self::award(explode(',',$winning_numbers));
|
|
|
+ $text = "虚拟开奖\n";
|
|
|
+
|
|
|
+ foreach($fake_bet_list as $k => $v){
|
|
|
+ $lastStr = self::getLastChar($v['rst_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 <= 30){
|
|
|
+
|
|
|
+ $text .= "私聊下注 【******".$lastStr."】 {$yl}\n";
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }else{
|
|
|
+ if($k+1 <= 30){
|
|
|
+ $text .= "私聊下注 【******".$lastStr."】 -{$v['amount']}\n";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ $inlineButton = self::getOperateButton();
|
|
|
+ // 群通知
|
|
|
+ self::bettingGroupNotice($text, $inlineButton, '');
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* @description: 获取中奖的奖项
|
|
|
* @param {*} $winning_numbers
|