22 lines
575 B
PHP
22 lines
575 B
PHP
<?php
|
|
|
|
namespace App\Console\Commands;
|
|
|
|
use App\Services\ProductPriceSyncService;
|
|
use Illuminate\Console\Command;
|
|
|
|
class SyncProductPrices extends Command
|
|
{
|
|
protected $signature = 'product:sync-prices';
|
|
|
|
protected $description = 'Fetch zaarbox price board + sync product DB (scheduler: every 30s)';
|
|
|
|
public function handle(ProductPriceSyncService $syncService): int
|
|
{
|
|
// کران: GET https://price.zaarbox.ir/api/free (یا zaarbox_api_url) → کش + UPDATE محصولات
|
|
$syncService->syncAll(true);
|
|
|
|
return self::SUCCESS;
|
|
}
|
|
}
|