From 40da308a085f94ef0f378921f33b928869ff8019 Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Thu, 26 Dec 2019 18:02:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=85=E5=80=BC=E7=8E=A9=E5=AE=B6--=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/Controller/DownloadController.class.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Application/Home/Controller/DownloadController.class.php b/Application/Home/Controller/DownloadController.class.php index 5f672dec9..c29528030 100644 --- a/Application/Home/Controller/DownloadController.class.php +++ b/Application/Home/Controller/DownloadController.class.php @@ -3238,14 +3238,15 @@ class DownloadController extends BaseController { $roles = M()->alias('record') ->table($subQuery) ->select(); - $totalSql = M('spend', 'tab_')->alias('uc') - ->field("$fieldS, $fieldToday as recharge_cost_today") + $total = M('spend', 'tab_')->alias('uc') + ->field($fieldS) ->where($map) - ->buildSql(); - $total = M()->table($totalSql) - ->alias('total') - ->field('sum(recharge_cost) as recharge_cost, sum(recharge_count) as recharge_count, sum(recharge_cost_today) as recharge_cost_today') ->find(); + $map['uc.pay_time'] = $spendMap['today.pay_time']; + $total['recharge_cost_today'] = M('spend', 'tab_')->alias('uc') + ->field('sum(uc.pay_amount) as recharge_cost_today') + ->where($map) + ->find()['recharge_cost_today']; $total['recharge_cost_today'] = empty($total['recharge_cost_today']) ? '0.00' :$total['recharge_cost_today']; $csvFileName = $xlsName.'.csv'; //设置好告诉浏览器要下载excel文件的headers