|
...
|
...
|
@@ -55,13 +55,15 @@ class ProjectController extends BaseController |
|
|
|
$map['type'] = $this->searchType($this->map['type']);
|
|
|
|
$map['extend_type'] = 0;//排除未续费项目
|
|
|
|
}
|
|
|
|
$filed = ['id', 'title', 'mysql_id' ,'channel','cooperate_date' ,'type', 'created_at'];
|
|
|
|
$lists = $project->formatQuery($map)->select($filed)->with('payment')->with('deploy_build')
|
|
|
|
$filed = ['id', 'title', 'mysql_id' ,'channel','cooperate_date' ,'type', 'remain_day' ,'created_at'];
|
|
|
|
$lists = $project->formatQuery($map)->orderBy('id','desc')->select($filed)->with('payment')->with('deploy_build')
|
|
|
|
->with('deploy_optimize')->with('online_check')->paginate($this->row, ['*'], 'page', $this->page);
|
|
|
|
if(!empty($lists)){
|
|
|
|
$lists = $lists->toArray();
|
|
|
|
$manageModel = new Manage();
|
|
|
|
$domainModel = new DomainInfo();
|
|
|
|
foreach ($lists['list'] as $k=>$item){
|
|
|
|
$item = $this->handleParam($item);
|
|
|
|
$item = $this->handleParam($item,$manageModel,$domainModel);
|
|
|
|
$lists['list'][$k] = $item;
|
|
|
|
}
|
|
|
|
}
|
|
...
|
...
|
@@ -75,8 +77,7 @@ class ProjectController extends BaseController |
|
|
|
* @method :post
|
|
|
|
* @time :2023/8/30 11:07
|
|
|
|
*/
|
|
|
|
public function handleParam(&$item){
|
|
|
|
$manageModel = new Manage();
|
|
|
|
public function handleParam(&$item,&$manageModel,&$domainModel){
|
|
|
|
if($item['mysql_id'] != 0 && $item['type'] != 0){
|
|
|
|
$data = APublicModel::getNumByProjectId($item['id']);
|
|
|
|
}
|
|
...
|
...
|
@@ -98,7 +99,7 @@ class ProjectController extends BaseController |
|
|
|
'type' => $item['type'],
|
|
|
|
'test_domain' => $item['deploy_build']['test_domain'] ?? 0,
|
|
|
|
'plan' =>Project::planMap()[$item['deploy_build']['plan']],
|
|
|
|
'domain' => $item['deploy_optimize']['domain'] ?? 0,
|
|
|
|
'domain' => !empty($item['deploy_optimize']['domain']) ? $domainModel->getDomain($item['deploy_optimize']['domain']) : '',
|
|
|
|
'created_at' => date('Y年m月d日', strtotime($item['created_at'])),
|
|
|
|
'product_num' => $data['product'] ?? 0,
|
|
|
|
'keyword_num' => $item['deploy_build']['keyword_num'] ?? 0,
|
|
...
|
...
|
@@ -107,31 +108,12 @@ class ProjectController extends BaseController |
|
|
|
'task_pending_num' => Task::getNumByProjectId($item['id'], [Task::STATUS_DONGING, Task::STATUS_WAIT]),
|
|
|
|
'optimist_status'=>$item['online_check']['optimist_status'] ?? 0,
|
|
|
|
'qa_status'=>$item['online_check']['qa_status'] ?? 0,
|
|
|
|
'service_day'=>$item['deploy_build']['service_duration'] - $this->compliance_day($item['id']),
|
|
|
|
'service_day'=>$item['remain_day'] ?? 0,
|
|
|
|
];
|
|
|
|
return $item;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param $yesterday
|
|
|
|
* @name :(服务达标天数)compliance_day
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/6/14 15:48
|
|
|
|
*/
|
|
|
|
public function compliance_day($project_id){
|
|
|
|
//服务达标天数
|
|
|
|
$rankDataModel = new RankData();
|
|
|
|
$rank_info = $rankDataModel->where(['project_id'=>$project_id,'lang'=>''])->select(['compliance_day'])->first();
|
|
|
|
if(empty($rank_info)){
|
|
|
|
$compliance_day = 0;
|
|
|
|
}else{
|
|
|
|
$compliance_day = $rank_info->compliance_day;
|
|
|
|
}
|
|
|
|
return $compliance_day;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :type类型
|
|
|
|
* @name :searchType
|
|
|
|
* @author :lyh
|
|
...
|
...
|
@@ -354,8 +336,8 @@ class ProjectController extends BaseController |
|
|
|
* @method :post
|
|
|
|
* @time :2023/8/30 19:01
|
|
|
|
*/
|
|
|
|
public function online_check(Request $request, OnlineCheckLogic $logic){
|
|
|
|
$request->validate([
|
|
|
|
public function online_check(OnlineCheckLogic $logic){
|
|
|
|
$this->request->validate([
|
|
|
|
'id'=>'required',
|
|
|
|
'type'=>'required|in:optimist,qa',
|
|
|
|
'status'=>'required|in:0,1'
|
|
...
|
...
|
@@ -384,7 +366,7 @@ class ProjectController extends BaseController |
|
|
|
'type.required' => '请选择审核类型'
|
|
|
|
]);
|
|
|
|
$belongGroupModel = new BelongingGroup();
|
|
|
|
$lists = $belongGroupModel->list($this->map);
|
|
|
|
$lists = $belongGroupModel->list($this->map,'name',['id','name','type'],'asc');
|
|
|
|
$this->response('success',Code::SUCCESS,$lists);
|
|
|
|
}
|
|
|
|
|
|
...
|
...
|
@@ -397,6 +379,7 @@ class ProjectController extends BaseController |
|
|
|
*/
|
|
|
|
public function getManagerList(){
|
|
|
|
$hrManagerModel = new ManageHr();
|
|
|
|
$this->map['status'] = $hrManagerModel::STATUS_ONE;
|
|
|
|
$lists = $hrManagerModel->list($this->map,'id',['id','manage_id','name','entry_position','is_leader']);
|
|
|
|
$this->response('success',Code::SUCCESS,$lists);
|
|
|
|
}
|
|
...
|
...
|
@@ -422,8 +405,32 @@ class ProjectController extends BaseController |
|
|
|
* @time :2023/8/14 10:29
|
|
|
|
*/
|
|
|
|
public function getDomain(){
|
|
|
|
$this->request->validate([
|
|
|
|
'project_id'=>'required',
|
|
|
|
],[
|
|
|
|
'project_id.required' => 'project_id不能为空',
|
|
|
|
]);
|
|
|
|
$domainModel = new DomainInfo();
|
|
|
|
$list = $domainModel->list(['status'=>0]);
|
|
|
|
$list = $domainModel->list(['status'=>0,'project_id'=>['or',$this->param['project_id']]]);
|
|
|
|
$this->response('success',Code::SUCCESS,$list);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 通过企业名称查询项目是否在服务中, 有项目并且在服务中的返回1, 其他的返回0
|
|
|
|
* @author zbj
|
|
|
|
* @date 2023/9/4
|
|
|
|
*/
|
|
|
|
public function getProjectInService(){
|
|
|
|
$company = $this->param['company'];
|
|
|
|
if(!$company){
|
|
|
|
$this->response('企业名称必传',Code::SYSTEM_ERROR);
|
|
|
|
}
|
|
|
|
$project = Project::where('company', $company)->first();
|
|
|
|
if($project && ($project['remain_day'] > 0 || in_array($project['type'], [0, 1,6]))){
|
|
|
|
$in_service = 1;
|
|
|
|
}else{
|
|
|
|
$in_service = 0;
|
|
|
|
}
|
|
|
|
$this->response('success',Code::SUCCESS, ['in_service' => $in_service]);
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|