This commit is contained in:
weiz 2024-06-06 17:54:44 +08:00
parent be95eedcb4
commit b254d444b6
2 changed files with 55 additions and 1 deletions
app/adminapi/controller

@ -17,7 +17,8 @@
$pending_project_num = MarketingContract::field('id')->where([
['review_status','=', 1],
['contract_type','=',0],
['business_nature','=',4]
['business_nature','=',4],
['status','=',0]
])->count();
//已立项项目
$approved_project_num = CostProject::field('id')->count();

@ -0,0 +1,53 @@
<?php
namespace app\adminapi\controller\supervision_project;
use app\adminapi\controller\BaseAdminController;
use app\common\model\dict\DictData;
use app\common\model\marketing\MarketingContract;
use app\common\model\supervision_project\SupervisionProject;
use app\common\model\supervision_work\SupervisionProblem;
class SupervisionStatisticsController extends BaseAdminController
{
//项目立项统计
public function project(){
//待立项项目
$pending_project_num = MarketingContract::field('id')->where([
['review_status','=', 1],
['contract_type','=',0],
['business_nature','=',1],
['status','=',0]
])->count();
//已立项项目
$approved_project_num = SupervisionProject::field('id')->count();
$result['data'] = [
[
'name' => '待立项项目',
'value' => $pending_project_num
],
[
'name' => '已立项项目',
'value' => $approved_project_num
]
];
return $this->success('success',$result);
}
//项目问题统计
public function problem(){
$problem_cate = DictData::where('type_value','problem_cate')->column('name','value');
$data = [];
foreach($problem_cate as $k=>$v){
$count = SupervisionProblem::where('problem_cate',$k)->count();
$data[] = [
'name' => $v,
'value' => $count
];
}
$result['data'] = $data;
return $this->success('success',$result);
}
//项目月报统计
}