update (kernel): fix pickup logic
This commit is contained in:
@@ -34,10 +34,16 @@ protected function schedule(Schedule $schedule)
|
||||
|
||||
if ($currentTime->gte($nextRun->next_run_time)) {
|
||||
|
||||
$shopee_seller_category = ShopeeSellerCategory::where('category_id', $category->id)->where(function($query) {
|
||||
$query->whereNull('last_ai_written_at')
|
||||
->orWhere('last_ai_written_at', '=', ShopeeSellerCategory::whereNotNull('last_ai_written_at')->orderBy('last_ai_written_at', 'asc')->value('last_ai_written_at'));
|
||||
})->first();
|
||||
$shopee_seller_category = ShopeeSellerCategory::where('category_id', $category->id)
|
||||
->orderByRaw('ISNULL(last_ai_written_at) DESC')
|
||||
->orderBy('last_ai_written_at', 'asc')
|
||||
->orderBy('id', 'asc')
|
||||
->first();
|
||||
|
||||
// $shopee_seller_category = ShopeeSellerCategory::where('category_id', $category->id)->where(function($query) {
|
||||
// $query->whereNull('last_ai_written_at')
|
||||
// ->orWhere('last_ai_written_at', '=', ShopeeSellerCategory::whereNotNull('last_ai_written_at')->orderBy('last_ai_written_at', 'asc')->value('last_ai_written_at'));
|
||||
// })->first();
|
||||
|
||||
$task = ShopeeSellerTopProductScraperJob::dispatch($shopee_seller_category->seller, $category->country_locale->country_iso, $category)
|
||||
->onQueue('default')
|
||||
|
||||
Reference in New Issue
Block a user