This commit is contained in:
2026-07-16 14:33:57 +03:30
parent 41c2a20fd0
commit 69538226d2
9 changed files with 28 additions and 73 deletions
+2 -7
View File
@@ -79,17 +79,12 @@ class ProductDisplayPriceService
$this->resolveFallbackPayload();
}
if (! app(ConfigService::class)->isStore()) {
app(ZaarboxPriceService::class)->cachedPriceList(false);
}
// فروشگاه و خانگی هر دو ممکن است reading_method / قیمت اپ داشته باشند
app(ZaarboxPriceService::class)->cachedPriceList(false);
}
public function enrichForApi(Collection|iterable $products): void
{
if (app(ConfigService::class)->isStore()) {
return;
}
$collection = collect($products);
$zaarbox = app(ZaarboxPriceService::class);
// مثل ادمین — روی cache miss یک بار fetch؛ نه فقط getCachedPriceListOnly
+7 -1
View File
@@ -37,7 +37,8 @@ class ProductPriceSyncService
: 'http://212.23.201.173:8381/price_list';
if ($feed === null) {
return false;
// حتی بدون فید مرجع، محصولات قیمت‌اپ را با مظنه زنده همگام کن
return $this->syncAppPriceProducts();
}
$products = Product::query()->whereNotNull('reading_method')->get();
@@ -77,6 +78,11 @@ class ProductPriceSyncService
app(PriceSyncLogService::class)->record($source, $sourceUrl, $liquidGoldPrice, $logItems);
// مثل خانگی: آبشده / قیمت‌اپ را هم با مظنه زنده در DB همگام کن (fallback نمایش)
if ($this->syncAppPriceProducts()) {
$synced = true;
}
if ($synced) {
app(PriceBroadcastService::class)->broadcastListIfChanged();
}