From 3d35ce37696f0ad756bbf3fc472136eb7c8d8b62 Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Wed, 19 Feb 2020 16:45:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=B9=B3=E5=8F=B0>=E8=B4=A2?= =?UTF-8?q?=E5=8A=A1=E7=AE=A1=E7=90=86>=E7=BB=93=E7=AE=97=E4=B8=AD?= =?UTF-8?q?=E5=BF=83--=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/Controller/FinanceController.class.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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')