作者 lyh

Merge branch 'master' of http://47.244.231.31:8099/zhl/globalso-v6 into develop

... ... @@ -55,8 +55,9 @@ class UpdateController extends BaseController
$list = DB::connection('custom_mysql')->table('gl_product')->where(['status'=>1,'project_id'=>$project_id])->get()->toArray();
if(!empty($list)){
foreach ($list as $v){
$v = (array)$v;
if(!empty($v['seo_mate'])){
$seo_arr = $v['seo_mate'];
$seo_arr = json_decode($v['seo_mate'], true);
//更新seo_title
if(!isset($seo_arr['title'])){
//生成seo_title
... ... @@ -89,6 +90,7 @@ class UpdateController extends BaseController
$list = DB::connection('custom_mysql')->table('gl_news')->where(['status'=>1,'project_id'=>$project_id])->get()->toArray();
if(!empty($list)){
foreach ($list as $k => $v){
$v = (array)$v;
$data = [];
if(empty($v['seo_title'])){
$data['seo_title'] = $this->ai_send('news_seo_title',$v['name']);
... ... @@ -116,6 +118,7 @@ class UpdateController extends BaseController
$list = DB::connection('custom_mysql')->table('gl_blog')->where(['status'=>1,'project_id'=>$project_id])->get()->toArray();
if(!empty($list)){
foreach ($list as $k => $v){
$v = (array)$v;
$data = [];
if(empty($v['seo_title'])){
$data['seo_title'] = $this->ai_send('blog_seo_title',$v['name']);
... ...
... ... @@ -571,18 +571,36 @@ class ProjectController extends BaseController
*/
public function getProjectByChannel(){
$id = $this->param['id'] ?? [];
$source_id = $this->param['channel_id']; //原系统渠道id
$source_id = $this->param['channel_id'] ?? 0; //原系统渠道id
$size = $this->param['page_size'] ?? 20;
$type = $this->param['type'] ?? '';
$company = $this->param['company'] ?? '';
$channel = Channel::where('source_id', $source_id)->first();
if(!$channel){
$this->response('渠道不存在',Code::SYSTEM_ERROR);
if(!$source_id && !$id){
$this->response('参数异常',Code::SYSTEM_ERROR);
}
$channel_id = 0;
if($source_id){
$channel = Channel::where('source_id', $source_id)->first();
if(!$channel){
$this->response('渠道不存在',Code::SYSTEM_ERROR);
}
$channel_id = $channel->id;
}
if ($id && FALSE == is_array($id))
$id = explode(',', $id);
$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 ($id){
if(!is_array($id)){
$id = explode(',', $id);
}
}
$data = Project::with(['deploy_build', 'deploy_optimize', 'online_check'])
->where('delete_status', 0)
->where(function ($query) use ($channel_id, $type, $company, $id){
if ($channel_id) {
$query->where('channel->channel_id', $channel_id);
}
if ($type) {
$query->where('type', $type);
}
... ...