diff --git a/app/adminapi/logic/cost_project/CostProjectStatisticsLogic.php b/app/adminapi/logic/cost_project/CostProjectStatisticsLogic.php index 044bbe921..04feb7c0c 100644 --- a/app/adminapi/logic/cost_project/CostProjectStatisticsLogic.php +++ b/app/adminapi/logic/cost_project/CostProjectStatisticsLogic.php @@ -17,6 +17,7 @@ namespace app\adminapi\logic\cost_project; use app\common\logic\BaseLogic; use app\common\model\cost_project\CostProject; +use app\common\model\dict\DictData; use app\common\model\financial\FinancialInvoice; use app\common\model\financial\FinancialRefund; use app\common\model\financial\FinancialSettlement; @@ -44,9 +45,17 @@ class CostProjectStatisticsLogic extends BaseLogic $where1=[ ['review_status','=', 1], ['contract_type','=',0], - ['business_nature','=',4], ['status','=',0] ]; + $where2=[ + ['review_status','=', 1], + ['status','=',1] + ]; + $data=DictData::where('type_value','cost_project')->column('value'); + if($data){ + $where1[]=['business_nature','in',$data]; + $where2[]=['business_nature','in',$data]; + } $total_apply_amount = $marketingContract->statistics_count($where1, $time, 'sum', ''); $apply_amount_value = $marketingContract->statistics_count($where1, $time, 'group', 'create_time'); $data[] = [ @@ -77,11 +86,6 @@ class CostProjectStatisticsLogic extends BaseLogic 'type' => 1, ]; //签约金额 - $where2=[ - ['review_status','=', 1], - ['business_nature','=',4], - ['status','=',1] - ]; $total_apply_amount = $marketingContract->statistics($where2, $time, 'sum', '', 'signed_amount'); $apply_amount_value = $marketingContract->statistics($where2, $time, 'group', 'create_time', 'signed_amount'); $data[] = [