|
...
|
...
|
@@ -275,7 +275,11 @@ class VideoTask extends Command |
|
|
|
}
|
|
|
|
}else{
|
|
|
|
$product_all_id = Product::where('thumb','!=',null)->where("status",Product::STATUS_ON)->inRandomOrder()->take(20)->pluck('id')->toArray();
|
|
|
|
$products = Product::whereIn("id", $product_all_id)->orderByRaw(DB::raw("FIELD(id, " . implode(',', $product_all_id) . ")"))->get();
|
|
|
|
if(empty($product_all_id)){
|
|
|
|
$products = [];
|
|
|
|
}else{
|
|
|
|
$products = Product::whereIn("id", $product_all_id)->orderByRaw(DB::raw("FIELD(id, " . implode(',', $product_all_id) . ")"))->get();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$data = [];
|
|
|
|
if (!empty($products)){
|
...
|
...
|
|