|
|
@@ -604,6 +604,37 @@ class BetService extends BaseService
|
|
|
return $msg;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @description: 开奖失败退回投注的
|
|
|
+ * @param {*} $issue_no
|
|
|
+ * @return {*}
|
|
|
+ */
|
|
|
+ public static function betFail($issue_no)
|
|
|
+ {
|
|
|
+ $list = self::findAll(['issue_no' => $issue_no, 'status' => self::model()::STATUS_STAY]);
|
|
|
+ foreach ($list->toArray() as $k => $v) {
|
|
|
+ $profit = $v['amount'];
|
|
|
+ WalletService::updateBalance($v['member_id'], $profit);
|
|
|
+
|
|
|
+ $walletInfo = WalletService::findOne(['member_id' => $v['member_id']]);
|
|
|
+ $balance = $walletInfo['available_balance'];
|
|
|
+
|
|
|
+ BalanceLogService::addLog($v['member_id'], $profit, $balance, ($balance + $profit), '中奖', $v['id'], '');
|
|
|
+
|
|
|
+ $text = $issue_no . "期开奖失败 \n";
|
|
|
+ $text .= "投注类型:{$v['keywords']} \n";
|
|
|
+ $text .= "投注金额:{$v['amount']} \n";
|
|
|
+ $text .= "投注的资金已退回您的钱包 \n";
|
|
|
+
|
|
|
+ self::asyncSendMessage($v['member_id'],$text);
|
|
|
+ $item = [];
|
|
|
+ $iem['status'] = self::model()::STATUS_CANCEL;
|
|
|
+ self::model()::where('id', $v['id'])->update($item);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* @description: 中奖结算
|
|
|
* @param {*} $issue_no
|