|
|
@@ -83,7 +83,7 @@ class MoneyBuy extends Model {
|
|
|
$moneyBuySpxBetween = ['money_time' => [$startTime, $endTime]];
|
|
|
$moneyBuySpxMdl = lm('money_buy_simplex', "commons");
|
|
|
// 获取订单记录
|
|
|
- $moneyBuySpxSlt = ['batch_id'];
|
|
|
+ $moneyBuySpxSlt = ['batch_id', 'order_id'];
|
|
|
$getMoneyBuySpx = $moneyBuySpxMdl -> moneyBuySimplex($moneyBuySpxSlt, $moneyBuySpxWhere, $moneyBuySpxBetween, '', '', 1);
|
|
|
// 获取全部订单id
|
|
|
$moneyBuyMthOr = [];
|
|
|
@@ -131,6 +131,42 @@ class MoneyBuy extends Model {
|
|
|
$moneyBuyMthSlt = ['status', 'bet_money', 'matchResult', 'result', 'home_team', 'batch_id', 'guest_team', 'condition', 'ctime', 'odds', 'odds_name', 'match_id', 'money_buy_match.game_code', 'money_buy_match.odds_code'];
|
|
|
$getMoneyBuyMth = $moneyBuyMthMdl -> moneyBuyMatch($moneyBuyMthSlt, $moneyBuyMthWhere, $moneyBuyMthOr, $begin, $pageSize);
|
|
|
$allCount = $moneyBuyMthMdl -> moneyBuyMatchTotal($moneyBuyMthWhere, $moneyBuyMthOr);
|
|
|
+ // 获取所有的比赛类型
|
|
|
+ $stGameTypeMdl = lm('StGameType', "commons");
|
|
|
+ $StGameTypeSlt = ['game_code'];
|
|
|
+ $StGameTypeWhr['status'] = 1;
|
|
|
+ $getStGameType = $stGameTypeMdl -> getGameType($StGameTypeSlt, $StGameTypeWhr);
|
|
|
+ $allMatch = [];
|
|
|
+ $allMatchInfo = [];
|
|
|
+ foreach ($getStGameType as $value) {
|
|
|
+ $allMatch[$value->game_code] = [];
|
|
|
+ $allMatchInfo[$value->game_code] = [];
|
|
|
+ }
|
|
|
+ // 循环获取所有的赛事ID
|
|
|
+ foreach ($getMoneyBuyMth as $value) {
|
|
|
+ $allMatch[$value->game_code][] = $value->match_id;
|
|
|
+ }
|
|
|
+ $stCompetitionMdl = lm('St_competition', "commons");
|
|
|
+ // 循环获取所有的赛事信息
|
|
|
+ foreach ($allMatch as $key => $value) {
|
|
|
+ $stCptWhrOr = array_unique($value);
|
|
|
+ $allMatchInfo[$key] = $stCompetitionMdl -> getMatch($key, $stCptWhrOr);
|
|
|
+ }
|
|
|
+ // 循环添加赛事时间
|
|
|
+ foreach ($getMoneyBuyMth as $k => $v) {
|
|
|
+ foreach ($allMatchInfo[$v->game_code] as $key => $value) {
|
|
|
+ if ($v->match_id == $value->id) {
|
|
|
+ $getMoneyBuyMth[$k]->match_date = $value->match_date;
|
|
|
+ $getMoneyBuyMth[$k]->match_time = $value->match_time;
|
|
|
+ $getMoneyBuyMth[$k]->lg_name = $value->name_chinese;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ foreach ($getMoneyBuySpx as $key => $value) {
|
|
|
+ if ($v->batch_id == $value['batch_id']) {
|
|
|
+ $getMoneyBuyMth[$k]->order_id = $value['order_id'];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
// 获取可加注所需要的查询条件
|
|
|
$commonFunction = C() -> get('commonFunction');
|
|
|
$stOddsWheres = [];
|
|
|
@@ -235,7 +271,7 @@ class MoneyBuy extends Model {
|
|
|
// 起始查询位置
|
|
|
$begin = ($currentPage - 1) * $pageSize;
|
|
|
// 获取订单记录
|
|
|
- $moneyBuyStrSlt = ['batch_id', 'gain_money', 'game_status', 'money', 'prize_money', 'money_time'];
|
|
|
+ $moneyBuyStrSlt = ['order_id', 'batch_id', 'gain_money', 'game_status', 'money', 'prize_money', 'money_time'];
|
|
|
$getMoneyBuyStr = $moneyBuyStrMdl -> moneyBuyStr($moneyBuyStrSlt, $moneyBuyStrWhere, $moneyBuyStrBetween, $begin, $pageSize, 1);
|
|
|
$allCount = $moneyBuyStrMdl -> moneyBuyStrTotal($moneyBuyStrWhere, $moneyBuyStrBetween);
|
|
|
// 获取全部订单id
|
|
|
@@ -260,6 +296,37 @@ class MoneyBuy extends Model {
|
|
|
$moneyBuyMthMdl = lm('Money_buy_match', "commons");
|
|
|
$moneyBuyMthSlt = ['status', 'matchResult', 'bet_money', 'home_team', 'guest_team', 'condition', 'odds', 'odds_name', 'match_id', 'batch_id', 'money_buy_match.game_code', 'money_buy_match.odds_code'];
|
|
|
$getMoneyBuyMth = $moneyBuyMthMdl -> moneyBuyMatch($moneyBuyMthSlt, $moneyBuyMthWhere, $moneyBuyMthOr, $begin, $pageSize);
|
|
|
+ // 获取所有的比赛类型
|
|
|
+ $stGameTypeMdl = lm('StGameType', "commons");
|
|
|
+ $StGameTypeSlt = ['game_code'];
|
|
|
+ $StGameTypeWhr['status'] = 1;
|
|
|
+ $getStGameType = $stGameTypeMdl -> getGameType($StGameTypeSlt, $StGameTypeWhr);
|
|
|
+ $allMatch = [];
|
|
|
+ $allMatchInfo = [];
|
|
|
+ foreach ($getStGameType as $value) {
|
|
|
+ $allMatch[$value->game_code] = [];
|
|
|
+ $allMatchInfo[$value->game_code] = [];
|
|
|
+ }
|
|
|
+ // 循环获取所有的赛事ID
|
|
|
+ foreach ($getMoneyBuyMth as $value) {
|
|
|
+ $allMatch[$value->game_code][] = $value->match_id;
|
|
|
+ }
|
|
|
+ $stCompetitionMdl = lm('St_competition', "commons");
|
|
|
+ // 循环获取所有的赛事信息
|
|
|
+ foreach ($allMatch as $key => $value) {
|
|
|
+ $stCptWhrOr = array_unique($value);
|
|
|
+ $allMatchInfo[$key] = $stCompetitionMdl -> getMatch($key, $stCptWhrOr);
|
|
|
+ }
|
|
|
+ // 循环添加赛事时间
|
|
|
+ foreach ($getMoneyBuyMth as $k => $v) {
|
|
|
+ foreach ($allMatchInfo[$v->game_code] as $key => $value) {
|
|
|
+ if ($v->match_id == $value->id) {
|
|
|
+ $getMoneyBuyMth[$k]->match_date = $value->match_date;
|
|
|
+ $getMoneyBuyMth[$k]->match_time = $value->match_time;
|
|
|
+ $getMoneyBuyMth[$k]->lg_name = $value->name_chinese;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
// 获取可加注所需要的查询条件
|
|
|
$commonFunction = C() -> get('commonFunction');
|
|
|
$stOddsWheres = [];
|
|
|
@@ -309,7 +376,7 @@ class MoneyBuy extends Model {
|
|
|
}
|
|
|
foreach ($getMoneyBuyMth as $k => $v) {
|
|
|
if ($value['batch_id'] == $v['batch_id']) {
|
|
|
- $getMoneyBuyStr[$key]['money_buy'][$k] = $v;
|
|
|
+ $getMoneyBuyStr[$key]['money_buy'][] = $v;
|
|
|
}
|
|
|
}
|
|
|
}
|