master
chenxiaojun 5 years ago
commit 4a53915c22

@ -83,6 +83,8 @@ class QueryController extends ThinkController
$this->assign('settlementTypeList', $settlementTypeList); $this->assign('settlementTypeList', $settlementTypeList);
$this->display();die; $this->display();die;
} }
} else {
$spendMap['tab_spend.selle_status'] = 0;
} }
$sortBy = I('sort_by', ''); $sortBy = I('sort_by', '');
@ -100,7 +102,6 @@ class QueryController extends ThinkController
} }
$spendMap['tab_spend.pay_status'] = 1; $spendMap['tab_spend.pay_status'] = 1;
$spendMap['tab_spend.selle_status'] = 0;
$spendMap['tab_spend.pay_time'] = ['between', [$beginTime, $endTime]]; $spendMap['tab_spend.pay_time'] = ['between', [$beginTime, $endTime]];
$spendMap['tab_spend.promote_id'] = ['in', $promoteIds]; $spendMap['tab_spend.promote_id'] = ['in', $promoteIds];
$spendField = "tab_spend.game_id, tab_spend.game_name, sum(tab_spend.pay_amount) as sum_amount, tab_spend.selle_ratio, sum(if(tab_spend.selle_ratio > 0, tab_spend.pay_amount * tab_spend.selle_ratio, 0)) as settlement_amount, FROM_UNIXTIME(tab_spend.`pay_time`, '%Y-%m-%d') as day"; $spendField = "tab_spend.game_id, tab_spend.game_name, sum(tab_spend.pay_amount) as sum_amount, tab_spend.selle_ratio, sum(if(tab_spend.selle_ratio > 0, tab_spend.pay_amount * tab_spend.selle_ratio, 0)) as settlement_amount, FROM_UNIXTIME(tab_spend.`pay_time`, '%Y-%m-%d') as day";
@ -144,6 +145,7 @@ class QueryController extends ThinkController
$zTotal = null_to_0(M('spend', 'tab_')->field($totalField)->where($spendMap)->find()['settlement_amount']);//累计 $zTotal = null_to_0(M('spend', 'tab_')->field($totalField)->where($spendMap)->find()['settlement_amount']);//累计
$zTotal = bcdiv($zTotal, 100 ,2); $zTotal = bcdiv($zTotal, 100 ,2);
} else { } else {
$spendMap['game_id'] = 157;
$totalField = 'sum(tab_spend.pay_amount) as sum_amount'; $totalField = 'sum(tab_spend.pay_amount) as sum_amount';
$zTotal = null_to_0(M('spend', 'tab_')->field($totalField)->where($spendMap)->find()['sum_amount']);//累计 $zTotal = null_to_0(M('spend', 'tab_')->field($totalField)->where($spendMap)->find()['sum_amount']);//累计
} }

Loading…
Cancel
Save