fix some bugs

This commit is contained in:
2026-07-14 13:45:59 +03:30
parent 8f3fb35b2b
commit 34bf65bc37
3 changed files with 13 additions and 4 deletions
@@ -117,6 +117,8 @@ class ProductController extends SuperController
$data = $this->filterProductData($request->all());
$product = Product::create($data);
$this->broadcastPricesAfterResponse(true);
return $this->resultCreate($product->id);
}
@@ -172,6 +174,7 @@ class ProductController extends SuperController
}
$product->update($data);
$this->broadcastPricesAfterResponse(true);
return response()->json(true);
}
@@ -497,10 +500,10 @@ class ProductController extends SuperController
return response()->json(['message' => 'نمایش محصولات طبق ساعات به‌روز شد.']);
}
private function broadcastPricesAfterResponse(): void
private function broadcastPricesAfterResponse(bool $force = false): void
{
dispatch(function () {
app(PriceBroadcastService::class)->broadcastAfterPriceUpdate();
dispatch(function () use ($force) {
app(PriceBroadcastService::class)->broadcastAfterPriceUpdate(null, $force);
})->afterResponse();
}
@@ -1180,7 +1180,7 @@ class SingleOrderController extends Controller
{
$display = app(ProductDisplayPriceService::class);
if ($display->usesFlaggedAppPrice($product)) {
if ($display->usesAppPrice($product)) {
return (int) round($display->resolveOrderBasePrice($product));
}