added merge wallet 5
This commit is contained in:
@@ -8,16 +8,22 @@ use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
/**
|
||||
* همگامسازی قیمت محصولاتی که reading_method دارند (قیمت متغیر از API).
|
||||
* همگامسازی قیمت محصولات متغیر از فید zaarbox و فید قدیمی.
|
||||
*/
|
||||
class ProductPriceSyncService
|
||||
{
|
||||
public function syncAll(): bool
|
||||
public function __construct(
|
||||
private readonly ZaarboxPriceService $zaarboxPriceService
|
||||
) {
|
||||
}
|
||||
|
||||
/** @param bool $forceRefresh درخواست تازه از https://price.zaarbox.ir/api/free (کران) */
|
||||
public function syncAll(bool $forceRefresh = false): bool
|
||||
{
|
||||
$synced = false;
|
||||
|
||||
try {
|
||||
if (app(ZaarboxPriceService::class)->syncProductsFromApi()) {
|
||||
if ($this->zaarboxPriceService->syncProductsFromApi($forceRefresh)) {
|
||||
$synced = true;
|
||||
}
|
||||
} catch (\Throwable $e) {
|
||||
|
||||
Reference in New Issue
Block a user