diff --git a/app/adminapi/controller/custom/CustomerDemandController.php b/app/adminapi/controller/custom/CustomerDemandController.php index 62ed86623..6a8e08b46 100644 --- a/app/adminapi/controller/custom/CustomerDemandController.php +++ b/app/adminapi/controller/custom/CustomerDemandController.php @@ -20,10 +20,6 @@ use app\adminapi\controller\BaseAdminController; use app\adminapi\lists\custom\CustomerDemandLists; use app\adminapi\logic\custom\CustomerDemandLogic; use app\adminapi\validate\custom\CustomerDemandValidate; -use app\common\model\custom\Custom; -use app\common\model\custom\CustomerDemand; -use app\common\model\project\Project; - /** * 客户需求控制器 diff --git a/app/adminapi/controller/statistics/StatisticsController.php b/app/adminapi/controller/statistics/StatisticsController.php index 3b89b6971..f562eb9c3 100644 --- a/app/adminapi/controller/statistics/StatisticsController.php +++ b/app/adminapi/controller/statistics/StatisticsController.php @@ -4,8 +4,14 @@ use app\adminapi\controller\BaseAdminController; use app\common\model\custom\Custom; + use app\common\model\custom\CustomerDemand; + use app\common\model\custom\CustomerDemandSolution; + use app\common\model\project\Competitor; use app\common\model\project\Project; + use app\common\model\project\ProjectEstimate; + use app\common\model\project\ProjectFollowUp; use app\common\model\project\ProjectInsuranceManagement; + use app\common\model\project\ProjectTypeSet; use think\response\Json; class StatisticsController extends BaseAdminController @@ -42,13 +48,37 @@ } //项目立项 - public function projectInitiation(){ + public function projectInitiation(): Json + { //立项总数 - $project_total = Project::field('id')->where('status',0)->count(); + $project_total = Project::field('id')->count(); //项目跟进 - $project_follow_total = ProjectInsuranceManagement::field('id')->count(); + $follow_total = ProjectFollowUp::field('id')->count(); //项目需求 -// $project_demand_total = + $demand_total = CustomerDemand::field('id')->count(); + //项目方案 + $solution_total = CustomerDemandSolution::field('id')->count(); + //项目概算 + $estimate_total = ProjectEstimate::field('id')->count(); + //竞争对手 + $competitor_total = Competitor::field('id')->count(); + //获取项目类型 + $project_type = ProjectTypeSet::field('id,name')->select()->toArray(); + $data = []; + foreach($project_type as $v){ + $count = Project::field('id')->where('project_type',$v['id'])->count(); + $data[] = [ + 'name' => $v['name'], + 'value' => $count + ]; + } + $result = compact('project_total','follow_total','demand_total','solution_total','estimate_total','competitor_total'); + $result['data'] = $data; + return $this->success('success',$result); } + //投标统计 + public function bidding() { + + } } \ No newline at end of file diff --git a/app/adminapi/validate/bid/BidBiddingDecisionValidate.php b/app/adminapi/validate/bid/BidBiddingDecisionValidate.php index 5abc3c153..a8de1d4f5 100644 --- a/app/adminapi/validate/bid/BidBiddingDecisionValidate.php +++ b/app/adminapi/validate/bid/BidBiddingDecisionValidate.php @@ -43,8 +43,8 @@ class BidBiddingDecisionValidate extends BaseValidate 'bidding_project_fund_source' => 'checkBiddingProjectFundSource', 'bidding_time' => 'dateFormat:Y-m-d', 'bid_type' => 'checkBidType', - 'is_margin' => 'in:1,2', - 'margin_amount' => 'float|egt:0', + 'is_margin' => 'require|in:1,2', + 'margin_amount' => 'requireIf:is_margin,1|float|egt:0', 'bid_opening_date' => 'dateFormat:Y-m-d', 'margin_amount_return_date' => 'dateFormat:Y-m-d', 'is_internal_resources' => 'in:1,2', @@ -61,7 +61,9 @@ class BidBiddingDecisionValidate extends BaseValidate 'project_estimation.float' => '项目估算值必须是数字', 'project_estimation.egt' => '项目估算值必须大于等于0', 'bidding_time.dateFormat' => '投标时间数据格式错误', + 'is_margin.require' => '请选择是否需要保证金', 'is_margin.in' => '是否需要保证金选项值错误', + 'margin_amount.requireIf' => '请填写保证金金额', 'margin_amount.float' => '保证金金额值必须是数字', 'margin_amount.egt' => '保证金金额值必须大于等于0', 'bid_opening_date.dateFormat' => '开标日期数据格式错误',