更新: 重构代码并优化财务统计逻辑中的统计功能

This commit is contained in:
mkm 2024-07-09 11:45:08 +08:00
parent f845ce949e
commit 0059ccc19e

View File

@ -51,10 +51,10 @@ class CostProjectStatisticsLogic extends BaseLogic
['review_status','=', 1], ['review_status','=', 1],
['status','=',1] ['status','=',1]
]; ];
$data=DictData::where('type_value','cost_project')->column('value'); $DictData=DictData::where('type_value','cost_project')->column('value');
if($data){ if($DictData){
$where1[]=['business_nature','in',$data]; $where1[]=['business_nature','in',$DictData];
$where2[]=['business_nature','in',$data]; $where2[]=['business_nature','in',$DictData];
} }
$total_apply_amount = $marketingContract->statistics_count($where1, $time, 'sum', ''); $total_apply_amount = $marketingContract->statistics_count($where1, $time, 'sum', '');
$apply_amount_value = $marketingContract->statistics_count($where1, $time, 'group', 'create_time'); $apply_amount_value = $marketingContract->statistics_count($where1, $time, 'group', 'create_time');