|
|
@@ -339,19 +339,23 @@ class MoneyBuy extends Model {
|
|
|
// 时间区间
|
|
|
$startTime = isset($_POST['startTime'])? $_POST['startTime'] : '1900-01-01 00:00:00';
|
|
|
$endTime = isset($_POST['endTime'])? $_POST['endTime'] : '3000-12-12 00:00:00';
|
|
|
+
|
|
|
$moneyBuyStrBetween = ['money_time' => [$startTime, $endTime]];
|
|
|
$moneyBuyStrMdl = lm('money_buy_str', "commons");
|
|
|
// 当前页
|
|
|
$currentPage = isset($_POST['currentPage']) ? $_POST['currentPage'] : "1";
|
|
|
// 分页大小
|
|
|
- $pageSize = isset($_POST['pageSize']) ? $_POST['pageSize'] : "10";
|
|
|
+ $pageSize = isset($_POST['pageSize']) ? $_POST['pageSize'] : '10';
|
|
|
+
|
|
|
// 起始查询位置
|
|
|
$begin = ($currentPage - 1) * $pageSize;
|
|
|
// 获取订单记录
|
|
|
$moneyBuyStrSlt = ['order_id', 'batch_id', 'gain_money','status as order_status','settle_status','game_status', 'money', 'prize_money', 'money_time'];
|
|
|
$getMoneyBuyStr = $moneyBuyStrMdl -> moneyBuyStr($moneyBuyStrSlt, $moneyBuyStrWhere, $moneyBuyStrBetween, $begin, $pageSize, 1);
|
|
|
+
|
|
|
$allCount = $moneyBuyStrMdl -> moneyBuyStrTotal($moneyBuyStrWhere, $moneyBuyStrBetween);
|
|
|
// 获取全部订单id
|
|
|
+ $order_ids = array_column($getMoneyBuyStr,'order_id');
|
|
|
$moneyBuyMthOr = [];
|
|
|
$allBatchId = array_unique($getMoneyBuyStr, SORT_REGULAR);
|
|
|
if (!$allBatchId) {
|
|
|
@@ -364,20 +368,20 @@ class MoneyBuy extends Model {
|
|
|
|
|
|
return $result;
|
|
|
}
|
|
|
- // foreach ($allBatchId as $key => $value) {
|
|
|
- // $moneyBuyMthOr[0][$key][0] = 'batch_id';
|
|
|
- // $moneyBuyMthOr[0][$key][1] = $value['batch_id'];
|
|
|
- // }
|
|
|
foreach ($allBatchId as $key => $value) {
|
|
|
- $moneyBuyMthOr[0][$key][0] = 'order_id';
|
|
|
- $moneyBuyMthOr[0][$key][1] = $value['order_id'];
|
|
|
+ $moneyBuyMthOr[0][$key][0] = 'batch_id';
|
|
|
+ $moneyBuyMthOr[0][$key][1] = $value['batch_id'];
|
|
|
}
|
|
|
+ // foreach ($allBatchId as $key => $value) {
|
|
|
+ // $moneyBuyMthOr[0][$key][0] = 'order_id';
|
|
|
+ // $moneyBuyMthOr[0][$key][1] = $value['order_id'];
|
|
|
+ // }
|
|
|
|
|
|
// 获取注单
|
|
|
$moneyBuyMthWhere['bet_type'] = 2;
|
|
|
$moneyBuyMthMdl = lm('Money_buy_match', "commons");
|
|
|
$moneyBuyMthSlt = ['status', 'matchresult', 'bet_money', 'home_team', 'guest_team', 'condition', 'odds', 'odds_name', 'match_id', 'batch_id','order_id', 'money_buy_match.game_code', 'money_buy_match.odds_code'];
|
|
|
- $getMoneyBuyMth = $moneyBuyMthMdl -> moneyBuyMatch($moneyBuyMthSlt, $moneyBuyMthWhere, $moneyBuyMthOr, $begin, $pageSize);
|
|
|
+ $getMoneyBuyMth = $moneyBuyMthMdl -> moneyBuyMatch($moneyBuyMthSlt, $moneyBuyMthWhere, $moneyBuyMthOr, $begin, $pageSize='','',$order_ids);
|
|
|
// 获取所有的比赛类型
|
|
|
$stGameTypeMdl = lm('StGameType', "commons");
|
|
|
$StGameTypeSlt = ['game_code'];
|
|
|
@@ -393,12 +397,14 @@ class MoneyBuy extends Model {
|
|
|
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) {
|
|
|
@@ -421,9 +427,11 @@ class MoneyBuy extends Model {
|
|
|
'odds_code' => $odds_code,
|
|
|
];
|
|
|
// 判断是否重复
|
|
|
- if (!$commonFunction -> judgeEqual($where, $stOddsWheres[$gameType])) {
|
|
|
- $stOddsWheres[$gameType][] = $where;
|
|
|
- }
|
|
|
+ // if (!$commonFunction -> judgeEqual($where, $stOddsWheres[$gameType])) {
|
|
|
+ // $stOddsWheres[$gameType][] = $where;
|
|
|
+ // }
|
|
|
+ $stOddsWheres[$gameType][] = $where;
|
|
|
+
|
|
|
}
|
|
|
// 查询数据下所有可加注的游戏
|
|
|
$stOddsModel = lm('stOdds','commons');
|
|
|
@@ -435,7 +443,9 @@ class MoneyBuy extends Model {
|
|
|
$getSstOdds[$key] = $stOddsModel -> stOdds($stOddsSelect, $value, $key);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
// 循环添加玩法和判断玩法是否可加注
|
|
|
+ /*
|
|
|
foreach ($getMoneyBuyMth as $key => $value) {
|
|
|
$typeSstOdds = $getSstOdds[$value -> game_code];
|
|
|
$thisSstOdds = [
|
|
|
@@ -449,6 +459,7 @@ class MoneyBuy extends Model {
|
|
|
$getMoneyBuyMth[$key] -> addBet = 1;
|
|
|
}
|
|
|
}
|
|
|
+ */
|
|
|
foreach ($getMoneyBuyStr as $key => $value) {
|
|
|
// 计算所赢金额.
|
|
|
if ($value->gain_money) {
|
|
|
@@ -470,11 +481,12 @@ class MoneyBuy extends Model {
|
|
|
$getMoneyBuyStr[$key]->settle_status = -1;//结算状态 无效
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
// 获取记录总数
|
|
|
$result['total'] = $allCount;
|
|
|
$result['list'] = $getMoneyBuyStr;
|
|
|
// 总页数计算
|
|
|
- $result['countPage'] = ceil($result['total'] / $pageSize);
|
|
|
+ $result['countPage'] = ceil($result['total'] / 10);
|
|
|
$result['currentPage'] = $currentPage;
|
|
|
|
|
|
return $result;
|
|
|
@@ -509,7 +521,7 @@ class MoneyBuy extends Model {
|
|
|
// 当前页
|
|
|
$currentPage = isset($_POST['currentPage']) ? $_POST['currentPage'] : "1";
|
|
|
// 分页大小
|
|
|
- $pageSize = isset($_POST['pageSize']) ? $_POST['pageSize'] : "10";
|
|
|
+ $pageSize = isset($_POST['pageSize']) ? $_POST['pageSize'] : 10;
|
|
|
// 起始查询位置
|
|
|
$begin = ($currentPage - 1) * $pageSize;
|
|
|
$moneyRecord = lm('Money_buy_simplex', "commons");
|