作者 李宇航

合并分支 'develop' 到 'master'

Develop



查看合并请求 !415
@@ -216,15 +216,16 @@ class VideoTask extends Command @@ -216,15 +216,16 @@ class VideoTask extends Command
216 $productIds[] = $item->id; 216 $productIds[] = $item->id;
217 } 217 }
218 if (count($productIds)<7){ 218 if (count($productIds)<7){
219 - $product_all_id = Product::where("project_id", $project_id)->whereNotIn('id', $productIds)->where("status",1)->pluck('id')->toArray();  
220 - $product_id = array_rand($product_all_id, 40-count($productIds)); 219 + $product_all_id = Product::where("project_id", $project_id)->whereNotIn('id', $productIds)->where("status",Product::STATUS_ON)->pluck('id')->toArray();
  220 + $number = 40;
  221 + $product_id = array_rand($product_all_id, min(count($product_all_id, $number-count($productIds))));
221 $randomData = Product::where("project_id", $project_id)->whereIn("id", $product_id)->get(); 222 $randomData = Product::where("project_id", $project_id)->whereIn("id", $product_id)->get();
222 $products = $productsQuery->merge($randomData); 223 $products = $productsQuery->merge($randomData);
223 }else{ 224 }else{
224 $products = $productsQuery; 225 $products = $productsQuery;
225 } 226 }
226 }else{ 227 }else{
227 - $product_all_id = Product::where("project_id", $project_id)->where("status",1)->pluck('id')->toArray(); 228 + $product_all_id = Product::where("project_id", $project_id)->where("status",Product::STATUS_ON)->pluck('id')->toArray();
228 $product_id = array_rand($product_all_id, 40); 229 $product_id = array_rand($product_all_id, 40);
229 $products = Product::where("project_id", $project_id)->whereIn("id", $product_id)->get(); 230 $products = Product::where("project_id", $project_id)->whereIn("id", $product_id)->get();
230 } 231 }
@@ -44,6 +44,7 @@ class Kernel extends ConsoleKernel @@ -44,6 +44,7 @@ class Kernel extends ConsoleKernel
44 $schedule->command('sync_manager')->dailyAt('01:00')->withoutOverlapping(1); //TODO::手机号码同步 每天执行一次 44 $schedule->command('sync_manager')->dailyAt('01:00')->withoutOverlapping(1); //TODO::手机号码同步 每天执行一次
45 45
46 $schedule->command('recommended_suppliers')->dailyAt('01:00')->withoutOverlapping(1); //每天凌晨1点执行一次生成推荐商 46 $schedule->command('recommended_suppliers')->dailyAt('01:00')->withoutOverlapping(1); //每天凌晨1点执行一次生成推荐商
  47 + $schedule->command('notice_c')->dailyAt('02:00')->withoutOverlapping(1); //每天凌晨1点执行一次生成推荐商
47 } 48 }
48 49
49 /** 50 /**