优化财务汇总

master
chenzhi 4 years ago
parent 90de336434
commit 6aeb73b759

@ -100,6 +100,7 @@ class FinancialSummaryController extends AdminController
"type"=>array("IN","1,{$_REQUEST['type']},4,5,6")
);
$dbres = SM("FinancialSummary","tab_")->field("*")->where($map)->select();
// dd( $dbres);
foreach ($dbres as $k => $v) {
if($v['type'] == 1){
@ -146,6 +147,7 @@ class FinancialSummaryController extends AdminController
}
ksort($senddata[$k]['count']);
}
// dd($senddata);
$this->assign('data', $senddata);
}
//获取历史年份

@ -626,7 +626,7 @@ class FinancialSummarySetController extends \Think\Controller
$sql = "{$data} UNION ALL {$coinData} UNION ALL {$officalData} UNION ALL {$spreadData} UNION ALL {$superSignData} UNION ALL {$testOrder}";
$data = M()->table("({$sql})a")
$data = M()->db(0)->table("({$sql})a")
->field("sum(cash_amount) cash_amount,sum(test_amount) test_amount,
sum(coin_amount) coin_amount,sum(offcial_amount) offcial_amount,
sum(spread_amount) spread_amount,sum(supersign_amount) supersign_amount,
@ -635,9 +635,7 @@ class FinancialSummarySetController extends \Think\Controller
->where("name is not null")
->group("merchant_id")
->select();
foreach ($data as $key => $value) {
$sum = $value['cash_amount']+$value['test_amount']+$value['coin_amount']+
$value['offcial_amount']+$value['spread_amount']+$value['supersign_amount']+$value['test_order_amount'];
$this->adddata[] = array(

Loading…
Cancel
Save