作者 lyh

gx

@@ -35,9 +35,8 @@ class RenewProjectController extends BaseController @@ -35,9 +35,8 @@ class RenewProjectController extends BaseController
35 * @time :2023/8/11 10:22 35 * @time :2023/8/11 10:22
36 */ 36 */
37 public function lists(Project $project){ 37 public function lists(Project $project){
38 - $arr = $this->getLessThanFifteenProjectId();  
39 - $map = $this->searchParam($this->map,$arr);  
40 - $filed = ['id', 'title', 'mysql_id' ,'channel','cooperate_date' ,'type', 'remain_day' ,'created_at','delete_status']; 38 + $map = $this->searchParam($this->map);
  39 + $filed = ['id', 'title', 'type' ,'mysql_id' ,'channel','cooperate_date' ,'type', 'remain_day' ,'created_at','delete_status'];
41 $lists = $project->formatQuery($map)->select($filed)->with('payment')->with('deploy_build') 40 $lists = $project->formatQuery($map)->select($filed)->with('payment')->with('deploy_build')
42 ->with('deploy_optimize')->with('online_check')->paginate($this->row, ['*'], 'page', $this->page); 41 ->with('deploy_optimize')->with('online_check')->paginate($this->row, ['*'], 'page', $this->page);
43 if(!empty($lists)){ 42 if(!empty($lists)){
@@ -52,25 +51,6 @@ class RenewProjectController extends BaseController @@ -52,25 +51,6 @@ class RenewProjectController extends BaseController
52 $this->response('success',Code::SUCCESS,$lists); 51 $this->response('success',Code::SUCCESS,$lists);
53 } 52 }
54 53
55 - /**  
56 - * @remark :获取小于15天的项目id  
57 - * @name :getlessThanFifteenProjectId  
58 - * @author :lyh  
59 - * @method :post  
60 - * @time :2023/8/30 11:49  
61 - */  
62 - public function getLessThanFifteenProjectId(){  
63 - $count = new Count();  
64 - $yesterday = Carbon::yesterday()->toDateString();  
65 - $count_list = $count->list(['date'=>$yesterday,'service_day'=>['<=',15]],'id',['project_id']);  
66 - $arr = [];  
67 - if(!empty($count_list)){  
68 - foreach ($count_list as $v){  
69 - $arr[] = $v['project_id'];  
70 - }  
71 - }  
72 - return $arr;  
73 - }  
74 54
75 /** 55 /**
76 * @remark :搜索参数处理 56 * @remark :搜索参数处理
@@ -79,20 +59,16 @@ class RenewProjectController extends BaseController @@ -79,20 +59,16 @@ class RenewProjectController extends BaseController
79 * @method :post 59 * @method :post
80 * @time :2023/8/30 10:30 60 * @time :2023/8/30 10:30
81 */ 61 */
82 - public function searchParam($param,&$arr){ 62 + public function searchParam($param){
83 $map = []; 63 $map = [];
84 //按类型搜索 64 //按类型搜索
85 if(!empty($param['search']) && !empty($param['search_type'])){ 65 if(!empty($param['search']) && !empty($param['search_type'])){
86 - if($this->param['search_type'] == 'domain'){  
87 - //搜索域名  
88 - $map['id'] = ['id', 'in', DeployOptimize::where('domain', 'like', "%{$param['search']}%")->where('id','in',$arr)->pluck('project_id')->toArray()];  
89 - }else{  
90 $map[$this->param['search_type']] = ['like', "%{$this->param['search']}%"]; 66 $map[$this->param['search_type']] = ['like', "%{$this->param['search']}%"];
91 } 67 }
92 - }  
93 //按类型搜索 68 //按类型搜索
94 - $map['id'] = ['in', $arr];  
95 $map['delete_status'] = 0; 69 $map['delete_status'] = 0;
  70 + $map['type'] = ['!=',[0,1]];
  71 + $map['remain_day'] = ['<=',15];
96 return $map; 72 return $map;
97 } 73 }
98 74