NASER add close condition in last api and close orders when app is closed
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user