|
|
@@ -320,7 +320,7 @@ class BetService extends BaseService
|
|
|
$rebate = Config::where('field', 'rebate')->first()->val;
|
|
|
$huishui_restriction = Config::where('field', 'huishui_restriction')->first()->val;
|
|
|
$huishui_percentage = Config::where('field', 'huishui_percentage')->first()->val;
|
|
|
- Rebate::addOrUpdate([
|
|
|
+ $rebate = Rebate::addOrUpdate([
|
|
|
'date' => $now,
|
|
|
'member_id' => $memberId,
|
|
|
'betting_amount' => $amount,
|
|
|
@@ -330,20 +330,17 @@ class BetService extends BaseService
|
|
|
'huishui_restriction' => $huishui_restriction,
|
|
|
'huishui_percentage' => $huishui_percentage,
|
|
|
]);
|
|
|
- // // 返利
|
|
|
- // $rebate = Config::where('field', 'rebate')->first()->val;
|
|
|
- // if($rebate > 0){
|
|
|
- // $rebateAmount = bcmul($amount, $rebate, 2); // 返利金额
|
|
|
- // if($rebateAmount > 0){
|
|
|
- // WalletService::updateBalance($memberId,$rebateAmount);
|
|
|
|
|
|
- // $walletInfo = WalletService::findOne(['member_id' => $memberId]);
|
|
|
- // $balance = $walletInfo['available_balance'];
|
|
|
-
|
|
|
- // BalanceLogService::addLog($memberId,$rebateAmount,$balance,($balance+$rebateAmount),'返水',$bet_id,'');
|
|
|
- // }
|
|
|
+ if (!RebateService::BibiReturn($rebate)) {
|
|
|
+ $text = lang("比比返失败");
|
|
|
+ $text .= "\n";
|
|
|
+ $msg['text'] = $text;
|
|
|
+ if ($messageId) {
|
|
|
+ $msg['reply_to_message_id'] = $messageId;
|
|
|
+ }
|
|
|
+ return $msg;
|
|
|
+ }
|
|
|
|
|
|
- // }
|
|
|
|
|
|
$text = lang('下注期数') . ":{$issueInfo->issue_no}\n";
|
|
|
$text .= lang("下注内容") . "\n";
|
|
|
@@ -647,7 +644,6 @@ class BetService extends BaseService
|
|
|
public static function betSettled($issue_no, $awards)
|
|
|
{
|
|
|
$list = self::findAll(['issue_no' => $issue_no, 'status' => self::model()::STATUS_STAY]);
|
|
|
-
|
|
|
// 大小单双的
|
|
|
$otherSum = self::model()::where('issue_no', $issue_no)->where('status', self::model()::STATUS_STAY)->whereIn('keywords', ['大', '小', '单', '双'])->sum('amount');
|
|
|
|
|
|
@@ -655,12 +651,6 @@ class BetService extends BaseService
|
|
|
$keywordsList = $fakeOpenData['keywordsList'];
|
|
|
$fakeOtherSum = $fakeOpenData['sum'];
|
|
|
$sum = $otherSum + $fakeOtherSum;
|
|
|
-
|
|
|
- $data = [];
|
|
|
- $text = $issue_no . "期开奖结果 \n";
|
|
|
- $text .= "-----本期开奖账单----- \n";
|
|
|
- $text .= "\n";
|
|
|
- // $text .=" 中奖类型 用户 投注金额 中奖金额 盈亏 \n";
|
|
|
$betNoticeNum = Config::where('field', 'bet_notice_num')->first()->val;
|
|
|
$betNoticeNum = explode(',', $betNoticeNum);
|
|
|
$betNoticeMini = $betNoticeNum[0] ?? 26;
|
|
|
@@ -733,11 +723,6 @@ class BetService extends BaseService
|
|
|
'profit' => $profit,
|
|
|
'yl' => $yl,
|
|
|
];
|
|
|
- // if ($k + 1 <= $realNoticeNum) {
|
|
|
-
|
|
|
- // // $text .= "会员下注 【" . $lastStr . "】{$v['amount']} {$profit} {$yl}\n";
|
|
|
- // $bet_num++;
|
|
|
- // }
|
|
|
// 结算
|
|
|
WalletService::updateBalance($v['member_id'], $profit);
|
|
|
|
|
|
@@ -811,8 +796,6 @@ class BetService extends BaseService
|
|
|
BalanceLogService::addLog($v['member_id'], $profit, $balance, ($balance + $profit), '中奖', $v['id'], '');
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
|
|
|
if (isset($openList[$v['member_id']])) {
|
|
|
$openList[$v['member_id']]['member_id'] = $v['member_id'];
|
|
|
@@ -831,78 +814,12 @@ class BetService extends BaseService
|
|
|
$openList[$v['member_id']]['win_amount'] = 0;
|
|
|
$openList[$v['member_id']]['is_send'] = true;
|
|
|
}
|
|
|
-
|
|
|
- // if ($k + 1 <= $realNoticeNum) {
|
|
|
- // // $text .= "会员下注 【" . $lastStr . "】{$v['amount']} {$v['profit']} -{$v['amount']}\n";
|
|
|
- // $bet_num++;
|
|
|
- // }
|
|
|
-
|
|
|
- // $memberList[$v['member_id']][] = [
|
|
|
- // 'member_id' => $v['member_id'],
|
|
|
- // 'amount' => $v['amount'],
|
|
|
- // 'keywords' => $v['keywords'],
|
|
|
- // 'profit' => 0,
|
|
|
- // 'yl' => '-'.$v['amount'],
|
|
|
- // ];
|
|
|
}
|
|
|
|
|
|
self::model()::where('id', $v['id'])->update($item);
|
|
|
}
|
|
|
-
|
|
|
- // foreach($openList as $k => $v){
|
|
|
- // $amount = $v['amount'];
|
|
|
- // // if($v['profit'] >= 0){
|
|
|
- // $profit = number_format($v['profit'],2);
|
|
|
- // $yl = bcsub($v['profit'], $v['amount'], 2); // 盈利
|
|
|
- // // $text .= "会员下注 【" . $v['lastStr'] . "】 {$amount} {$profit} {$yl}\n";
|
|
|
-
|
|
|
- // if(++$bet_num <= $realNoticeNum){
|
|
|
- // if(empty($v['openKeywords'])){
|
|
|
- // $openKeyword = '-';
|
|
|
- // }else{
|
|
|
- // $openKeyword = implode(',', $v['openKeywords']);
|
|
|
- // }
|
|
|
- // $text .= "用户ID:{$v['lastStr']} \n";
|
|
|
- // $text .= "下注类型:[".implode(',', $v['keywords'])."] \n";
|
|
|
- // $text .= "中奖类型:[".$openKeyword."] \n";
|
|
|
- // $text .= "投注金额:{$amount} \n";
|
|
|
- // $text .= "中奖金额:{$v['win_amount']} \n";
|
|
|
- // $text .= "派彩金额:{$profit} \n";
|
|
|
- // $text .= "盈亏金额:{$yl} \n";
|
|
|
- // $text .= "-------------------------------- \n";
|
|
|
- // }
|
|
|
-
|
|
|
-
|
|
|
- // $text2 = "{$issue_no}期开奖结果 \n";
|
|
|
- // $text2 .= "下注类型:[".implode(',', $v['keywords'])."] \n";
|
|
|
- // $text2 .= "中奖类型:[".$openKeyword."] \n";
|
|
|
- // $text2 .= "投注金额:{$amount} \n";
|
|
|
- // $text2 .= "中奖金额:{$v['win_amount']} \n";
|
|
|
- // $text2 .= "派彩金额:{$profit} \n";
|
|
|
- // $text2 .= "盈亏金额:{$yl} \n";
|
|
|
-
|
|
|
- // $keyboard = [];
|
|
|
- // $keyboard[] = [
|
|
|
- // ['text' => "开奖历史", 'callback_data' => "showLotteryHistory@@" . $issue_no]
|
|
|
- // ];
|
|
|
- // SendTelegramMessageJob::dispatch($v['member_id'],$text2,$keyboard);
|
|
|
- // // self::sendMessage($v['member_id'],$text2);
|
|
|
- // // }else{
|
|
|
- // // $text .= "会员下注 【" . $v['lastStr'] . "】 {$amount} 0 -{$amount}\n";
|
|
|
- // // }
|
|
|
-
|
|
|
- // }
|
|
|
-
|
|
|
- $inlineButton = self::getOperateButton();
|
|
|
-
|
|
|
- $rand_num = $noticeNum - $bet_num;
|
|
|
-
|
|
|
$openList = array_merge($openList, $fakeOpenData['list']);
|
|
|
|
|
|
- // 群通知
|
|
|
- // self::bettingGroupNotice($text, $inlineButton, '');
|
|
|
- // SendTelegramGroupMessageJob::dispatch($text,$inlineButton,'');
|
|
|
-
|
|
|
self::lotteryNotice($openList, $issue_no, $keywordsList);
|
|
|
}
|
|
|
|