khanegi setting and prices records
This commit is contained in:
@@ -175,15 +175,12 @@ class ProductController extends SuperController
|
||||
return response()->json($products);
|
||||
}
|
||||
|
||||
// آبشده خانگی — ادمین: sync از کش؛ کاربر: enrich بدون UPDATE
|
||||
if (! str_contains(request()->path(), '/customer/')) {
|
||||
app(ProductPriceSyncService::class)->syncAll(false);
|
||||
}
|
||||
|
||||
// آبشده خانگی — کران قیمت را آپدیت میکند؛ list فقط از DB میخواند
|
||||
$products = Product::with(['file'])->where('active', 1)->get();
|
||||
|
||||
if (str_contains(request()->path(), '/customer/')) {
|
||||
$displayPriceService = app(ProductDisplayPriceService::class);
|
||||
$displayPriceService->warmLivePriceCache();
|
||||
$displayPriceService->enrichForApi($products);
|
||||
$products->each(function (Product $product) use ($displayPriceService) {
|
||||
if (! $displayPriceService->hasCustomerDisplayPrice($product)) {
|
||||
|
||||
Reference in New Issue
Block a user