NASER optimize get price and order from goldir
This commit is contained in:
@@ -29,13 +29,16 @@ class SingleOrderController extends Controller
|
||||
{
|
||||
public function store(Request $request)
|
||||
{
|
||||
$goldir = Cnt::where('key', 'goldir_closed')->first();
|
||||
if(isset($goldir) && $goldir['value'] == "true"){
|
||||
$data = $request->all();
|
||||
|
||||
$goldir_closed = Cnt::where('key', 'goldir_closed')->first()['value'] == "true";
|
||||
$goldir_buy = Cnt::where('key', 'goldir_open_buy')->first()['value'] == "false" && $data['direction'] == 1;
|
||||
$goldir_sell = Cnt::where('key', 'goldir_open_sell')->first()['value'] == "false" && $data['direction'] == 2;
|
||||
if($goldir_closed || $goldir_buy || $goldir_sell){
|
||||
throw new UnprocessableEntityHttpException('عدم ارائه سرویس.');
|
||||
}
|
||||
|
||||
// throw new UnprocessableEntityHttpException('به دلیل نوسانات سفارشات بسته میباشد.');
|
||||
$data = $request->all();
|
||||
$transactionType = $data['direction'] == 1 ? "خرید" : "فروش";
|
||||
if (auth('customer')->id()) {
|
||||
$data['customer_id'] = auth('customer')->id();
|
||||
|
||||
Reference in New Issue
Block a user