|
...
|
...
|
@@ -571,12 +571,17 @@ class ProjectController extends BaseController |
|
|
|
public function getProjectByChannel(){
|
|
|
|
$source_id = $this->param['channel_id']; //原系统渠道id
|
|
|
|
$size = $this->param['page_size'] ?? 20;
|
|
|
|
$type = $this->param['type'];
|
|
|
|
$channel = Channel::where('source_id', $source_id)->first();
|
|
|
|
if(!$channel){
|
|
|
|
$this->response('渠道不存在',Code::SYSTEM_ERROR);
|
|
|
|
}
|
|
|
|
|
|
|
|
$list = Project::where('channel->channel_id', $channel->id)->orderBy('id', 'desc')->paginate($size);
|
|
|
|
$list = Project::where('channel->channel_id', $channel->id)->where(function ($query) use ($type){
|
|
|
|
if($type){
|
|
|
|
$query->where('type', $type);
|
|
|
|
}
|
|
|
|
})->orderBy('id', 'desc')->paginate($size);
|
|
|
|
$this->response('success',Code::SUCCESS, $list);
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|