|
|
@@ -7,6 +7,7 @@ use Illuminate\Support\Facades\Log;
|
|
|
use App\Jobs\Manager\Process\LowPriceGoodsJobs;
|
|
|
use App\Jobs\Manager\Process\ViolationProductJobs;
|
|
|
use App\Jobs\Manager\Process\ViolationStoreJobs;
|
|
|
+use App\Models\Manager\External\Company as CompanyModel;
|
|
|
|
|
|
/**
|
|
|
* 定时清洗采集的商品数据
|
|
|
@@ -41,13 +42,17 @@ class DailyTask extends Command
|
|
|
|
|
|
try {
|
|
|
Log::info('每日数据清洗任务执行中 - ' . now());
|
|
|
- $message_data = ['page' => '1', 'limit' => '50'];
|
|
|
- //执行低价挂网商品数据清洗任务
|
|
|
- LowPriceGoodsJobs::dispatch($message_data);
|
|
|
- //执行违规商品数据清洗任务
|
|
|
- ViolationProductJobs::dispatch($message_data);
|
|
|
- //执行违规门店数据清洗任务
|
|
|
- ViolationStoreJobs::dispatch($message_data);
|
|
|
+ $CompanyModel = new CompanyModel();
|
|
|
+ $company_list = $CompanyModel->select(['id', 'status'])->where('status', 0)->orderByDesc('cleaning_priority')->get()->toarray();
|
|
|
+ foreach ($company_list as $company) {
|
|
|
+ $message_data = ['company_id' => $company['id'], 'page' => '1', 'limit' => '50'];
|
|
|
+ //执行低价挂网商品数据清洗任务
|
|
|
+ LowPriceGoodsJobs::dispatch($message_data);
|
|
|
+ //执行违规商品数据清洗任务
|
|
|
+ ViolationProductJobs::dispatch($message_data);
|
|
|
+ //执行违规门店数据清洗任务
|
|
|
+ ViolationStoreJobs::dispatch($message_data);
|
|
|
+ }
|
|
|
// 示例:记录日志
|
|
|
$this->info('每日任务执行完成!');
|
|
|
return Command::SUCCESS;
|