作者 lyh

gx

@@ -228,7 +228,8 @@ class VideoTask extends Command @@ -228,7 +228,8 @@ class VideoTask extends Command
228 } 228 }
229 }else{ 229 }else{
230 $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();
231 - $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))));
232 $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();
233 } 234 }
234 } 235 }
@@ -241,7 +242,13 @@ class VideoTask extends Command @@ -241,7 +242,13 @@ class VideoTask extends Command
241 if(count($data) > 13){ 242 if(count($data) > 13){
242 break; 243 break;
243 } 244 }
244 - $data[] = ['url'=>getImageUrl($item->thumb['url']),'title'=>$item->title,'product_id'=>$item->id]; 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 + }
  251 + $data[] = ['url'=>getImageUrl($item->thumb['url']),'title'=>$item->title];
245 } 252 }
246 } 253 }
247 return $data; 254 return $data;
@@ -64,6 +64,7 @@ class Notice extends Command @@ -64,6 +64,7 @@ class Notice extends Command
64 return false; 64 return false;
65 } 65 }
66 foreach ($domainList as $v1){ 66 foreach ($domainList as $v1){
  67 +
67 //TODO::通知C端 68 //TODO::通知C端
68 $this->curlDelRoute($v1['domain'],$v1['project_id']); 69 $this->curlDelRoute($v1['domain'],$v1['project_id']);
69 } 70 }