Merge branch 'release-1.0.0' of 47.111.118.107:wmtx/platform into release-1.0.0

master
zhanglingsheng 5 years ago
commit a2062684af

@ -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

@ -1872,14 +1872,15 @@ class QueryController extends BaseController
list($records, $pagination, $count) = $this->paginate($query);
$totalSql = M('spend', 'tab_')->alias('s')
->field("$fieldS, $fieldToday as recharge_cost_today")
$total = M('spend', 'tab_')->alias('s')
->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['s.pay_time'] = $spendMap['today.pay_time'];
$total['recharge_cost_today'] = M('spend', 'tab_')->alias('s')
->field('sum(s.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'];
if (!empty($records)) {

Loading…
Cancel
Save