NASER add close condition in last api and close orders when app is closed

This commit is contained in:
gholak tala
2026-05-02 18:47:02 +00:00
parent 562edfadd9
commit f602b519a1
2 changed files with 35 additions and 7 deletions
@@ -45,6 +45,16 @@ class SingleOrderController extends Controller
if (auth('customer')->id()) {
$data['customer_id'] = auth('customer')->id();
$latestPrice = Price::latest()->first();
if($latestPrice->price == 0){
throw new UnprocessableEntityHttpException('عدم ارائه سرویس.');
}
if($this->Config('close_price') == 'true'){
if(Cnt::where('key', 'app_closed')->first()['value'] == "true"){
throw new UnprocessableEntityHttpException('عدم ارائه سرویس.');
}
}
$data['all_price'] = $latestPrice;
$data['price'] = $latestPrice->price;
$data['price_id'] = $latestPrice->id;