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)) {
|
if ($currentTime->gte($nextRun->next_run_time)) {
|
||||||
|
|
||||||
$shopee_seller_category = ShopeeSellerCategory::where('category_id', $category->id)->where(function($query) {
|
$shopee_seller_category = ShopeeSellerCategory::where('category_id', $category->id)
|
||||||
$query->whereNull('last_ai_written_at')
|
->orderByRaw('ISNULL(last_ai_written_at) DESC')
|
||||||
->orWhere('last_ai_written_at', '=', ShopeeSellerCategory::whereNotNull('last_ai_written_at')->orderBy('last_ai_written_at', 'asc')->value('last_ai_written_at'));
|
->orderBy('last_ai_written_at', 'asc')
|
||||||
})->first();
|
->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)
|
$task = ShopeeSellerTopProductScraperJob::dispatch($shopee_seller_category->seller, $category->country_locale->country_iso, $category)
|
||||||
->onQueue('default')
|
->onQueue('default')
|
||||||
|
|||||||
Reference in New Issue
Block a user