|
...
|
...
|
@@ -35,9 +35,8 @@ class RenewProjectController extends BaseController |
|
|
|
* @time :2023/8/11 10:22
|
|
|
|
*/
|
|
|
|
public function lists(Project $project){
|
|
|
|
$arr = $this->getLessThanFifteenProjectId();
|
|
|
|
$map = $this->searchParam($this->map,$arr);
|
|
|
|
$filed = ['id', 'title', 'mysql_id' ,'channel','cooperate_date' ,'type', 'remain_day' ,'created_at','delete_status'];
|
|
|
|
$map = $this->searchParam($this->map);
|
|
|
|
$filed = ['id', 'title', 'type' ,'mysql_id' ,'channel','cooperate_date' ,'type', 'remain_day' ,'created_at','delete_status'];
|
|
|
|
$lists = $project->formatQuery($map)->select($filed)->with('payment')->with('deploy_build')
|
|
|
|
->with('deploy_optimize')->with('online_check')->paginate($this->row, ['*'], 'page', $this->page);
|
|
|
|
if(!empty($lists)){
|
|
...
|
...
|
@@ -52,25 +51,6 @@ class RenewProjectController extends BaseController |
|
|
|
$this->response('success',Code::SUCCESS,$lists);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :获取小于15天的项目id
|
|
|
|
* @name :getlessThanFifteenProjectId
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/8/30 11:49
|
|
|
|
*/
|
|
|
|
public function getLessThanFifteenProjectId(){
|
|
|
|
$count = new Count();
|
|
|
|
$yesterday = Carbon::yesterday()->toDateString();
|
|
|
|
$count_list = $count->list(['date'=>$yesterday,'service_day'=>['<=',15]],'id',['project_id']);
|
|
|
|
$arr = [];
|
|
|
|
if(!empty($count_list)){
|
|
|
|
foreach ($count_list as $v){
|
|
|
|
$arr[] = $v['project_id'];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return $arr;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :搜索参数处理
|
|
...
|
...
|
@@ -79,20 +59,16 @@ class RenewProjectController extends BaseController |
|
|
|
* @method :post
|
|
|
|
* @time :2023/8/30 10:30
|
|
|
|
*/
|
|
|
|
public function searchParam($param,&$arr){
|
|
|
|
public function searchParam($param){
|
|
|
|
$map = [];
|
|
|
|
//按类型搜索
|
|
|
|
if(!empty($param['search']) && !empty($param['search_type'])){
|
|
|
|
if($this->param['search_type'] == 'domain'){
|
|
|
|
//搜索域名
|
|
|
|
$map['id'] = ['id', 'in', DeployOptimize::where('domain', 'like', "%{$param['search']}%")->where('id','in',$arr)->pluck('project_id')->toArray()];
|
|
|
|
}else{
|
|
|
|
$map[$this->param['search_type']] = ['like', "%{$this->param['search']}%"];
|
|
|
|
}
|
|
|
|
$map[$this->param['search_type']] = ['like', "%{$this->param['search']}%"];
|
|
|
|
}
|
|
|
|
//按类型搜索
|
|
|
|
$map['id'] = ['in', $arr];
|
|
|
|
$map['delete_status'] = 0;
|
|
|
|
$map['type'] = ['!=',[0,1]];
|
|
|
|
$map['remain_day'] = ['<=',15];
|
|
|
|
return $map;
|
|
|
|
}
|
|
|
|
|
...
|
...
|
|