|
|
|
|
@ -193,7 +193,7 @@ class OrdersController extends CommonController
|
|
|
|
|
* )
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
public function getOrder($id)
|
|
|
|
|
public function getOrder($id, $ajax = true)
|
|
|
|
|
{
|
|
|
|
|
$model = $this->_getOrderModel();
|
|
|
|
|
$order = $model->with([
|
|
|
|
|
@ -220,7 +220,10 @@ class OrdersController extends CommonController
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
$order->group_by_paramedic = collect($group_by_paramedic);
|
|
|
|
|
return response()->json($order->toArray());
|
|
|
|
|
if ($ajax === true) {
|
|
|
|
|
return response()->json($order->toArray());
|
|
|
|
|
}
|
|
|
|
|
return $order;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@ -521,7 +524,11 @@ class OrdersController extends CommonController
|
|
|
|
|
event(new OrderAssigned($order));
|
|
|
|
|
}
|
|
|
|
|
DB::commit();
|
|
|
|
|
return $this->getOrder($order->id);
|
|
|
|
|
$order = $this->getOrder($order->id, false);
|
|
|
|
|
if (request()->paramedic_id) {
|
|
|
|
|
$order = (new AttachAffectedOrders)($order);
|
|
|
|
|
}
|
|
|
|
|
return response()->json($order->toArray());
|
|
|
|
|
} catch (\Exception $exception) {
|
|
|
|
|
DB::rollBack();
|
|
|
|
|
return response()->json([
|
|
|
|
|
|