作者 lyh

gx

@@ -101,19 +101,21 @@ class VideoTask extends Command @@ -101,19 +101,21 @@ class VideoTask extends Command
101 continue; 101 continue;
102 } 102 }
103 $keywordInfo = $this->getKeywordImage($val->id,$task_project->project_id,$domainInfo['domain']); 103 $keywordInfo = $this->getKeywordImage($val->id,$task_project->project_id,$domainInfo['domain']);
104 - $array = [  
105 - 'project_id' => $task_project->project_id,  
106 - 'keyword_id' => $val->id,  
107 - 'keyword' => $val->title,  
108 - 'data' => json_encode(['url' => $keywordInfo['url'],'title' => $keywordInfo['title'],  
109 - 'description' => $keywordInfo['keyword_content'], 'images' => $keywordInfo['product_list'],  
110 - 'keywords' => $keywordInfo['keyword_list'], 'logo_bg' => $logo_bg]),  
111 - 'status' => KeywordVideoTaskLog::STATUS_INIT,  
112 - 'updated_at' => date('Y-m-d H:i:s'),  
113 - 'created_at' => date('Y-m-d H:i:s'),  
114 - ];  
115 - KeywordVideoTaskLog::insert($array);  
116 - $sub_task_num--; 104 + if(!empty($keywordInfo['product_list'])){
  105 + $array = [
  106 + 'project_id' => $task_project->project_id,
  107 + 'keyword_id' => $val->id,
  108 + 'keyword' => $val->title,
  109 + 'data' => json_encode(['url' => $keywordInfo['url'],'title' => $keywordInfo['title'],
  110 + 'description' => $keywordInfo['keyword_content'], 'images' => $keywordInfo['product_list'],
  111 + 'keywords' => $keywordInfo['keyword_list'], 'logo_bg' => $logo_bg]),
  112 + 'status' => KeywordVideoTaskLog::STATUS_INIT,
  113 + 'updated_at' => date('Y-m-d H:i:s'),
  114 + 'created_at' => date('Y-m-d H:i:s'),
  115 + ];
  116 + KeywordVideoTaskLog::insert($array);
  117 + $sub_task_num--;
  118 + }
117 } 119 }
118 $task_project->status = KeywordVideoTask::STATUS_CLOSE; 120 $task_project->status = KeywordVideoTask::STATUS_CLOSE;
119 $task_project->save(); 121 $task_project->save();
@@ -237,7 +239,7 @@ class VideoTask extends Command @@ -237,7 +239,7 @@ class VideoTask extends Command
237 $productIds[] = $item->id; 239 $productIds[] = $item->id;
238 } 240 }
239 if (count($productIds)<7){ 241 if (count($productIds)<7){
240 - $product_all_id = Product::where("project_id", $project_id)->whereNotIn('id', $productIds)->where("status",Product::STATUS_ON)->pluck('id')->toArray(); 242 + $product_all_id = Product::where("project_id", $project_id)->where('thumb','!=',null)->whereNotIn('id', $productIds)->where("status",Product::STATUS_ON)->pluck('id')->toArray();
241 $number = 40; 243 $number = 40;
242 $array_count = count($product_all_id); 244 $array_count = count($product_all_id);
243 if ($array_count > 0) { 245 if ($array_count > 0) {
@@ -249,7 +251,7 @@ class VideoTask extends Command @@ -249,7 +251,7 @@ class VideoTask extends Command
249 $products = $productsQuery; 251 $products = $productsQuery;
250 } 252 }
251 }else{ 253 }else{
252 - $product_all_id = Product::where("project_id", $project_id)->where("status",Product::STATUS_ON)->pluck('id')->toArray(); 254 + $product_all_id = Product::where("project_id", $project_id)->where('thumb','!=',null)->where("status",Product::STATUS_ON)->pluck('id')->toArray();
253 $number = 40; 255 $number = 40;
254 $array_count = count($product_all_id); 256 $array_count = count($product_all_id);
255 if ($array_count > 0) 257 if ($array_count > 0)