|
@@ -18,6 +18,7 @@ use App\Models\ASide\APublicModel; |
|
@@ -18,6 +18,7 @@ use App\Models\ASide\APublicModel; |
|
18
|
use App\Models\Channel\Channel;
|
18
|
use App\Models\Channel\Channel;
|
|
19
|
use App\Models\HomeCount\Count;
|
19
|
use App\Models\HomeCount\Count;
|
|
20
|
use App\Models\Manage\Manage;
|
20
|
use App\Models\Manage\Manage;
|
|
|
|
21
|
+use App\Models\Project\DeployBuild;
|
|
21
|
use App\Models\Project\DeployOptimize;
|
22
|
use App\Models\Project\DeployOptimize;
|
|
22
|
use App\Models\Project\Project;
|
23
|
use App\Models\Project\Project;
|
|
23
|
use App\Models\Task\Task;
|
24
|
use App\Models\Task\Task;
|
|
@@ -32,27 +33,65 @@ class RenewProjectController extends BaseController |
|
@@ -32,27 +33,65 @@ class RenewProjectController extends BaseController |
|
32
|
* @method :post
|
33
|
* @method :post
|
|
33
|
* @time :2023/8/11 10:22
|
34
|
* @time :2023/8/11 10:22
|
|
34
|
*/
|
35
|
*/
|
|
35
|
- public function lists(ProjectLogic $logic){
|
36
|
+ public function lists(Project $project){
|
|
|
|
37
|
+ $arr = $this->getLessThanFifteenProjectId();
|
|
|
|
38
|
+ $map = [];
|
|
|
|
39
|
+ if(!empty($arr)){
|
|
|
|
40
|
+ $this->searchParam($map,$this->map,$arr);
|
|
|
|
41
|
+ //按类型搜索
|
|
|
|
42
|
+ $map['id'] = ['in', $arr];
|
|
|
|
43
|
+ }
|
|
|
|
44
|
+ $filed = ['id', 'title', 'mysql_id' ,'channel','cooperate_date' ,'type', 'created_at'];
|
|
|
|
45
|
+ $lists = $project->formatQuery($map)->select($filed)->with('payment')->with('deploy_build')
|
|
|
|
46
|
+ ->with('deploy_optimize')->with('online_check')->paginate($this->row, ['*'], 'page', $this->page);
|
|
|
|
47
|
+ if(!empty($lists)){
|
|
|
|
48
|
+ $lists = $lists->toArray();
|
|
|
|
49
|
+ foreach ($lists['list'] as $k=>$item){
|
|
|
|
50
|
+ $item = $this->handleParam($item);
|
|
|
|
51
|
+ $lists['list'][$k] = $item;
|
|
|
|
52
|
+ }
|
|
|
|
53
|
+ }
|
|
|
|
54
|
+ $this->response('success',Code::SUCCESS,$lists);
|
|
|
|
55
|
+ }
|
|
|
|
56
|
+
|
|
|
|
57
|
+ /**
|
|
|
|
58
|
+ * @remark :获取小于15天的项目id
|
|
|
|
59
|
+ * @name :getlessThanFifteenProjectId
|
|
|
|
60
|
+ * @author :lyh
|
|
|
|
61
|
+ * @method :post
|
|
|
|
62
|
+ * @time :2023/8/30 11:49
|
|
|
|
63
|
+ */
|
|
|
|
64
|
+ public function getLessThanFifteenProjectId(){
|
|
36
|
$count = new Count();
|
65
|
$count = new Count();
|
|
37
|
$yesterday = Carbon::yesterday()->toDateString();
|
66
|
$yesterday = Carbon::yesterday()->toDateString();
|
|
38
|
$count_list = $count->list(['date'=>$yesterday,'service_day'=>['<=',15]],'id',['project_id']);
|
67
|
$count_list = $count->list(['date'=>$yesterday,'service_day'=>['<=',15]],'id',['project_id']);
|
|
39
|
$arr = [];
|
68
|
$arr = [];
|
|
40
|
- foreach ($count_list as $v){
|
|
|
|
41
|
- $arr[] = $v['project_id'];
|
69
|
+ if(!empty($count_list)){
|
|
|
|
70
|
+ foreach ($count_list as $v){
|
|
|
|
71
|
+ $arr[] = $v['project_id'];
|
|
|
|
72
|
+ }
|
|
42
|
}
|
73
|
}
|
|
43
|
- $sort = ['id' => 'desc'];
|
74
|
+ return $arr;
|
|
|
|
75
|
+ }
|
|
|
|
76
|
+
|
|
|
|
77
|
+ /**
|
|
|
|
78
|
+ * @remark :搜索参数处理
|
|
|
|
79
|
+ * @name :searchParam
|
|
|
|
80
|
+ * @author :lyh
|
|
|
|
81
|
+ * @method :post
|
|
|
|
82
|
+ * @time :2023/8/30 10:30
|
|
|
|
83
|
+ */
|
|
|
|
84
|
+ public function searchParam(&$map,$param,&$arr){
|
|
44
|
//按类型搜索
|
85
|
//按类型搜索
|
|
45
|
- $map[] = ['id', 'in', $arr];
|
|
|
|
46
|
- if(!empty($this->param['search']) && !empty($this->param['search_type'])){
|
86
|
+ if(!empty($param['search']) && !empty($param['search_type'])){
|
|
47
|
if($this->param['search_type'] == 'domain'){
|
87
|
if($this->param['search_type'] == 'domain'){
|
|
48
|
//搜索域名
|
88
|
//搜索域名
|
|
49
|
- $map[] = ['id', 'in', DeployOptimize::where('domain', 'like', "%{$this->param['search']}%")->where('id','in',$arr)->pluck('project_id')->toArray()];
|
89
|
+ $map['id'] = ['id', 'in', DeployOptimize::where('domain', 'like', "%{$param['search']}%")->where('id','in',$arr)->pluck('project_id')->toArray()];
|
|
50
|
}else{
|
90
|
}else{
|
|
51
|
- $map[] = [$this->param['search_type'], 'like', "%{$this->param['search']}%"];
|
91
|
+ $map[$this->param['search_type']] = ['like', "%{$this->param['search']}%"];
|
|
52
|
}
|
92
|
}
|
|
53
|
}
|
93
|
}
|
|
54
|
- $data = $logic->getList($map, $sort,['*'],$this->row);
|
|
|
|
55
|
- $this->response('success',Code::SUCCESS,$data);
|
94
|
+ return $map;
|
|
56
|
}
|
95
|
}
|
|
57
|
|
96
|
|
|
58
|
/**
|
97
|
/**
|