|
...
|
...
|
@@ -217,7 +217,7 @@ class VideoTask extends Command |
|
|
|
}
|
|
|
|
if (count($productIds)<7){
|
|
|
|
$product_all_id = Product::where("project_id", $project_id)->whereNotIn('id', $productIds)->where("status",1)->pluck('id')->toArray();
|
|
|
|
$product_id = array_rand($product_all_id, 30-count($productIds));
|
|
|
|
$product_id = array_rand($product_all_id, 40-count($productIds));
|
|
|
|
$randomData = Product::where("project_id", $project_id)->whereIn("id", $product_id)->get();
|
|
|
|
$products = $productsQuery->merge($randomData);
|
|
|
|
}else{
|
|
...
|
...
|
@@ -225,7 +225,7 @@ class VideoTask extends Command |
|
|
|
}
|
|
|
|
}else{
|
|
|
|
$product_all_id = Product::where("project_id", $project_id)->where("status",1)->pluck('id')->toArray();
|
|
|
|
$product_id = array_rand($product_all_id, 30);
|
|
|
|
$product_id = array_rand($product_all_id, 40);
|
|
|
|
$products = Product::where("project_id", $project_id)->whereIn("id", $product_id)->get();
|
|
|
|
}
|
|
|
|
}
|
...
|
...
|
|