|
|
@@ -116,6 +116,9 @@ class MoneyBuy extends Model {
|
|
|
$moneyBuyMthOr[1][0][1] = -1;
|
|
|
$moneyBuyMthOr[1][1][0] = 'result';
|
|
|
$moneyBuyMthOr[1][1][1] = 4;
|
|
|
+ } elseif ($_POST['result'] === '0') {
|
|
|
+ $moneyBuyMthOr[1][0][0] = 'result';
|
|
|
+ $moneyBuyMthOr[1][0][1] = 0;
|
|
|
}
|
|
|
// 当前页
|
|
|
$currentPage = isset($_POST['currentPage']) ? $_POST['currentPage'] : "1";
|
|
|
@@ -125,7 +128,7 @@ class MoneyBuy extends Model {
|
|
|
$begin = ($currentPage - 1) * $pageSize;
|
|
|
// 获取注单
|
|
|
$moneyBuyMthMdl = lm('Money_buy_match', "commons");
|
|
|
- $moneyBuyMthSlt = ['status', 'bet_money', 'home_team', 'guest_team', 'condition', 'odds', 'odds_name', 'match_id', 'money_buy_match.game_code', 'money_buy_match.odds_code'];
|
|
|
+ $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);
|
|
|
// 获取可加注所需要的查询条件
|
|
|
@@ -156,6 +159,28 @@ class MoneyBuy extends Model {
|
|
|
}
|
|
|
// 循环添加玩法和判断玩法是否可加注
|
|
|
foreach ($getMoneyBuyMth as $key => $value) {
|
|
|
+ $getMoneyBuyMth[$key]->willMoney = $value->bet_money * $value->odds;
|
|
|
+ if ($value->result) {
|
|
|
+ switch (intval($value->result)) {
|
|
|
+ case 1:
|
|
|
+ $oddsDiscount = 1 + $value->odds;
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ $oddsDiscount = 1;
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+ $oddsDiscount = 1 + $value->odds * 0.5;
|
|
|
+ break;
|
|
|
+ case 4:
|
|
|
+ $oddsDiscount = 0.5;
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ $oddsDiscount = 0;
|
|
|
+ }
|
|
|
+ $getMoneyBuyMth[$key]->winMoney = $value->bet_money * ($oddsDiscount - 1);
|
|
|
+ } else {
|
|
|
+ $getMoneyBuyMth[$key]->winMoney = 0;
|
|
|
+ }
|
|
|
$typeSstOdds = $getSstOdds[$value -> game_code];
|
|
|
$thisSstOdds = [
|
|
|
'match_id' => $value -> match_id,
|
|
|
@@ -210,7 +235,7 @@ class MoneyBuy extends Model {
|
|
|
// 起始查询位置
|
|
|
$begin = ($currentPage - 1) * $pageSize;
|
|
|
// 获取订单记录
|
|
|
- $moneyBuyStrSlt = ['batch_id', 'money'];
|
|
|
+ $moneyBuyStrSlt = ['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
|
|
|
@@ -233,7 +258,7 @@ class MoneyBuy extends Model {
|
|
|
$moneyBuyMthWhere['bet_type'] = 2;
|
|
|
// 获取注单
|
|
|
$moneyBuyMthMdl = lm('Money_buy_match', "commons");
|
|
|
- $moneyBuyMthSlt = ['status', 'bet_money', 'home_team', 'guest_team', 'condition', 'odds', 'odds_name', 'match_id', 'batch_id', 'money_buy_match.game_code', 'money_buy_match.odds_code'];
|
|
|
+ $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);
|
|
|
// 获取可加注所需要的查询条件
|
|
|
$commonFunction = C() -> get('commonFunction');
|
|
|
@@ -276,6 +301,12 @@ class MoneyBuy extends Model {
|
|
|
}
|
|
|
}
|
|
|
foreach ($getMoneyBuyStr as $key => $value) {
|
|
|
+ // 计算所赢金额.
|
|
|
+ if ($value->gain_money) {
|
|
|
+ $getMoneyBuyStr[$key]->winMoney = $value->gain_money - $value->money;
|
|
|
+ } else {
|
|
|
+ $getMoneyBuyStr[$key]->winMoney = 0;
|
|
|
+ }
|
|
|
foreach ($getMoneyBuyMth as $k => $v) {
|
|
|
if ($value['batch_id'] == $v['batch_id']) {
|
|
|
$getMoneyBuyStr[$key]['money_buy'][$k] = $v;
|
|
|
@@ -349,7 +380,7 @@ class MoneyBuy extends Model {
|
|
|
Render([], '2001', lang('Common','Api') -> get('user does login'));
|
|
|
}
|
|
|
// 用户ID
|
|
|
- $moneyBuyWhere['account_identity'] =$userInfo['identity'];
|
|
|
+ $moneyBuyWhere['account_identity'] = $userInfo['identity'];
|
|
|
// 时间区间
|
|
|
$endTime = date('Y-m-d H:i:s');
|
|
|
if ($userInfo['statisticsTime']) {
|