作者 李宇航

合并分支 'develop' 到 'master'

Develop



查看合并请求 !415
... ... @@ -216,15 +216,16 @@ class VideoTask extends Command
$productIds[] = $item->id;
}
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, 40-count($productIds));
$product_all_id = Product::where("project_id", $project_id)->whereNotIn('id', $productIds)->where("status",Product::STATUS_ON)->pluck('id')->toArray();
$number = 40;
$product_id = array_rand($product_all_id, min(count($product_all_id, $number-count($productIds))));
$randomData = Product::where("project_id", $project_id)->whereIn("id", $product_id)->get();
$products = $productsQuery->merge($randomData);
}else{
$products = $productsQuery;
}
}else{
$product_all_id = Product::where("project_id", $project_id)->where("status",1)->pluck('id')->toArray();
$product_all_id = Product::where("project_id", $project_id)->where("status",Product::STATUS_ON)->pluck('id')->toArray();
$product_id = array_rand($product_all_id, 40);
$products = Product::where("project_id", $project_id)->whereIn("id", $product_id)->get();
}
... ...
... ... @@ -44,6 +44,7 @@ class Kernel extends ConsoleKernel
$schedule->command('sync_manager')->dailyAt('01:00')->withoutOverlapping(1); //TODO::手机号码同步 每天执行一次
$schedule->command('recommended_suppliers')->dailyAt('01:00')->withoutOverlapping(1); //每天凌晨1点执行一次生成推荐商
$schedule->command('notice_c')->dailyAt('02:00')->withoutOverlapping(1); //每天凌晨1点执行一次生成推荐商
}
/**
... ...