推广平台>财务管理>结算中心--更新

master
chenxiaojun 5 years ago
parent a863f7ff99
commit 3d35ce3769

@ -121,19 +121,20 @@ class FinanceController extends BaseController
sum(if(pay_time >= $thisMonth, if(selle_ratio > 0, pay_amount * selle_ratio, 0), 0)) as this_month_income,
sum(if((pay_time >= $yesterday and pay_time < $thisDay), if(selle_ratio > 0, pay_amount * selle_ratio, 0), 0)) as yesterday_income,
sum(if(pay_time < $thisDay, if(selle_status = 0, pay_amount * selle_ratio, 0), 0)) as balance,
sum(if(selle_status = 0, pay_amount, 0)) as not_withdrawn_amount")
sum(if(selle_status = 0, pay_amount * selle_ratio, 0)) as not_withdrawn_amount")
->where($map)
->find();
foreach ($income as &$value) {
$value = bcdiv($value, 100, 2);
}
$withdrawMap['promote_id'] = $this->loginPromote['id'];
$withdrawMap['status'] = ['neq', 2];
//已提现总额
$income['withdrawn_amount'] = M('withdraw', 'tab_')->field('sum(sum_money) as withdrawn_amount')->where($withdrawMap)->find()['withdrawn_amount'];
foreach ($income as &$value) {
$value = bcdiv($value, 100, 2);
}
$income['withdrawn_amount'] = $income['withdrawn_amount'] ?? '0.00';
$withdrawMap['status'] = ['not in', [-2, -1]];
$withdrawns = M('withdraw', 'tab_')->field('settlement_begin_time, settlement_end_time')

Loading…
Cancel
Save