Files
boursecu_server/app/Console/Commands/SyncProductPrices.php
T
2026-06-11 19:23:16 +03:30

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;
}
}