作者 周海龙

合并分支 'zhl' 到 'master'

u



查看合并请求 !18
... ... @@ -573,6 +573,7 @@ class ProjectController extends BaseController
* @date 2023/9/11
*/
public function getProjectByChannel(){
$id = $this->param['id'] ?? [];
$source_id = $this->param['channel_id']; //原系统渠道id
$size = $this->param['page_size'] ?? 20;
$type = $this->param['type'] ?? '';
... ... @@ -581,14 +582,19 @@ class ProjectController extends BaseController
if(!$channel){
$this->response('渠道不存在',Code::SYSTEM_ERROR);
}
if (empty($id) || FALSE == is_array($id))
$id = [];
$data = Project::with(['deploy_build', 'deploy_optimize', 'online_check'])->where('channel->channel_id', $channel->id)->where('delete_status', 0)->where(function ($query) use ($type, $company){
$data = Project::with(['deploy_build', 'deploy_optimize', 'online_check'])->where(['channel->channel_id' => $channel->id, 'delete_status' => 0])->where(function ($query) use ($type, $company, $id){
if ($type) {
$query->where('type', $type);
}
if ($company) {
$query->where('company', 'like', '%' . $company . '%');
}
if ($id) {
$query->whereIn('id', $id);
}
})->orderBy('id', 'desc')->paginate($size)->toArray();
$list = [];
foreach ($data['list'] as $item){
... ...