fix some bugs
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user