Merge branch 'develop' of http://47.244.231.31:8099/zhl/globalso-v6 into bate
正在显示
4 个修改的文件
包含
26 行增加
和
17 行删除
| @@ -107,7 +107,9 @@ class VideoTask extends Command | @@ -107,7 +107,9 @@ class VideoTask extends Command | ||
| 107 | 'project_id' => $task_project->project_id, | 107 | 'project_id' => $task_project->project_id, |
| 108 | 'keyword_id' => $val->id, | 108 | 'keyword_id' => $val->id, |
| 109 | 'keyword' => $val->title, | 109 | 'keyword' => $val->title, |
| 110 | - 'data' => json_encode(['url' => $keywordInfo['url'],'title' => $keywordInfo['title'], 'description' => $keywordInfo['keyword_content'], 'images' => $keywordInfo['product_list'], 'keywords' => $keywordInfo['keyword_list']]), | 110 | + 'data' => json_encode(['url' => $keywordInfo['url'],'title' => $keywordInfo['title'], |
| 111 | + 'description' => $keywordInfo['keyword_content'], 'images' => $keywordInfo['product_list'], | ||
| 112 | + 'keywords' => $keywordInfo['keyword_list']]), | ||
| 111 | 'status' => KeywordVideoTaskLog::STATUS_INIT, | 113 | 'status' => KeywordVideoTaskLog::STATUS_INIT, |
| 112 | 'updated_at' => date('Y-m-d H:i:s'), | 114 | 'updated_at' => date('Y-m-d H:i:s'), |
| 113 | 'created_at' => date('Y-m-d H:i:s'), | 115 | 'created_at' => date('Y-m-d H:i:s'), |
| @@ -226,7 +228,8 @@ class VideoTask extends Command | @@ -226,7 +228,8 @@ class VideoTask extends Command | ||
| 226 | } | 228 | } |
| 227 | }else{ | 229 | }else{ |
| 228 | $product_all_id = Product::where("project_id", $project_id)->where("status",Product::STATUS_ON)->pluck('id')->toArray(); | 230 | $product_all_id = Product::where("project_id", $project_id)->where("status",Product::STATUS_ON)->pluck('id')->toArray(); |
| 229 | - $product_id = array_rand($product_all_id, 40); | 231 | + $number = 40; |
| 232 | + $product_id = array_rand($product_all_id, min(count($product_all_id, $number-count($productIds)))); | ||
| 230 | $products = Product::where("project_id", $project_id)->whereIn("id", $product_id)->get(); | 233 | $products = Product::where("project_id", $project_id)->whereIn("id", $product_id)->get(); |
| 231 | } | 234 | } |
| 232 | } | 235 | } |
| @@ -239,6 +242,12 @@ class VideoTask extends Command | @@ -239,6 +242,12 @@ class VideoTask extends Command | ||
| 239 | if(count($data) > 13){ | 242 | if(count($data) > 13){ |
| 240 | break; | 243 | break; |
| 241 | } | 244 | } |
| 245 | + if (strpos($item->keyword_id, ','.$productKeyword->id.',') === false) { | ||
| 246 | + //不包含 | ||
| 247 | + $productModel = new Product(); | ||
| 248 | + $keyword_id = $item->keyword_id . $productKeyword->id.','; | ||
| 249 | + $productModel->edit(['keyword_id'=>$keyword_id],['id'=>$item->id]); | ||
| 250 | + } | ||
| 242 | $data[] = ['url'=>getImageUrl($item->thumb['url']),'title'=>$item->title]; | 251 | $data[] = ['url'=>getImageUrl($item->thumb['url']),'title'=>$item->title]; |
| 243 | } | 252 | } |
| 244 | } | 253 | } |
| @@ -48,11 +48,11 @@ class RankData extends BaseCommands | @@ -48,11 +48,11 @@ class RankData extends BaseCommands | ||
| 48 | 48 | ||
| 49 | Log::channel('rank_data')->info('开始-排名数据'); | 49 | Log::channel('rank_data')->info('开始-排名数据'); |
| 50 | //同步api_no | 50 | //同步api_no |
| 51 | - try { | ||
| 52 | - $this->SyncApiNo(); | ||
| 53 | - } catch (\Exception $e) { | ||
| 54 | - Log::channel('rank_data')->error('同步api_no失败:' . $e->getMessage()); | ||
| 55 | - } | 51 | +// try { |
| 52 | +// $this->SyncApiNo(); | ||
| 53 | +// } catch (\Exception $e) { | ||
| 54 | +// Log::channel('rank_data')->error('同步api_no失败:' . $e->getMessage()); | ||
| 55 | +// } | ||
| 56 | 56 | ||
| 57 | 57 | ||
| 58 | //所有项目 今日是否达标 重置 | 58 | //所有项目 今日是否达标 重置 |
| @@ -70,7 +70,7 @@ class RankData extends BaseCommands | @@ -70,7 +70,7 @@ class RankData extends BaseCommands | ||
| 70 | //当日所有站点谷歌收录数据 | 70 | //当日所有站点谷歌收录数据 |
| 71 | $site_res = $api->getSiteRes(); | 71 | $site_res = $api->getSiteRes(); |
| 72 | if (!$site_res) { | 72 | if (!$site_res) { |
| 73 | - return false; | 73 | + Log::channel('rank_data')->error('谷歌收录数据获取失败'); |
| 74 | } | 74 | } |
| 75 | foreach ($list as $item) { | 75 | foreach ($list as $item) { |
| 76 | echo $item['api_no'] . PHP_EOL; | 76 | echo $item['api_no'] . PHP_EOL; |
| @@ -55,7 +55,7 @@ class UpdateRoute extends Command | @@ -55,7 +55,7 @@ class UpdateRoute extends Command | ||
| 55 | */ | 55 | */ |
| 56 | public function handle(){ | 56 | public function handle(){ |
| 57 | $projectModel = new Project(); | 57 | $projectModel = new Project(); |
| 58 | - $list = $projectModel->list(['id'=>206]); | 58 | + $list = $projectModel->list(['id'=>969]); |
| 59 | $data = []; | 59 | $data = []; |
| 60 | foreach ($list as $v){ | 60 | foreach ($list as $v){ |
| 61 | echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL; | 61 | echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL; |
| @@ -30,10 +30,10 @@ class KeywordRequest extends FormRequest | @@ -30,10 +30,10 @@ class KeywordRequest extends FormRequest | ||
| 30 | public function rules() | 30 | public function rules() |
| 31 | { | 31 | { |
| 32 | return [ | 32 | return [ |
| 33 | - 'title'=>'required|max:50', | ||
| 34 | - 'seo_title'=>'max:200', | ||
| 35 | - 'seo_keywords'=>'max:200', | ||
| 36 | - 'seo_description'=>'max:200', | 33 | + 'title'=>'required|max:200', |
| 34 | + 'seo_title'=>'max:255', | ||
| 35 | + 'seo_keywords'=>'max:500', | ||
| 36 | + 'seo_description'=>'max:500', | ||
| 37 | 'related_news_ids'=>'array|max:2', | 37 | 'related_news_ids'=>'array|max:2', |
| 38 | 'related_blog_ids'=>'array|max:2', | 38 | 'related_blog_ids'=>'array|max:2', |
| 39 | ]; | 39 | ]; |
| @@ -43,10 +43,10 @@ class KeywordRequest extends FormRequest | @@ -43,10 +43,10 @@ class KeywordRequest extends FormRequest | ||
| 43 | { | 43 | { |
| 44 | return [ | 44 | return [ |
| 45 | 'title.required' => '请输入关键词', | 45 | 'title.required' => '请输入关键词', |
| 46 | - 'title.max' => '关键词不能超过50个字符', | ||
| 47 | - 'seo_title.max' => 'SEO标题不能超过200个字符', | ||
| 48 | - 'seo_keywords.max' => 'SEO关键词不能超过200个字符', | ||
| 49 | - 'seo_description.max' => 'SEO描述不能超过200个字符', | 46 | + 'title.max' => '关键词不能超过200个字符', |
| 47 | + 'seo_title.max' => 'SEO标题不能超过255个字符', | ||
| 48 | + 'seo_keywords.max' => 'SEO关键词不能超过500个字符', | ||
| 49 | + 'seo_description.max' => 'SEO描述不能超过500个字符', | ||
| 50 | 'related_news_ids.max' => '关联新闻不能超过两条', | 50 | 'related_news_ids.max' => '关联新闻不能超过两条', |
| 51 | 'related_blog_ids.max' => '关联博客不能超过两条', | 51 | 'related_blog_ids.max' => '关联博客不能超过两条', |
| 52 | ]; | 52 | ]; |
-
请 注册 或 登录 后发表评论