diff --git a/Application/Home/Controller/FinanceController.class.php b/Application/Home/Controller/FinanceController.class.php index 9bf7327c1..750d97afb 100644 --- a/Application/Home/Controller/FinanceController.class.php +++ b/Application/Home/Controller/FinanceController.class.php @@ -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')