|
|
|
|
@ -332,6 +332,8 @@ class OrdersController extends CommonController
|
|
|
|
|
{
|
|
|
|
|
DB::beginTransaction();
|
|
|
|
|
$request = request();
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
$has_orders = Orders::where("customer_id", $this->customer->id)->whereIn("status", [Orders::STATUS_UNCONFIRMED, Orders::STATUS_UNASSIGNED, Orders::STATUS_ONGOING])->count();
|
|
|
|
|
if ($has_orders) {
|
|
|
|
|
return response()->json([
|
|
|
|
|
@ -361,6 +363,7 @@ class OrdersController extends CommonController
|
|
|
|
|
"name" => $request->patient_name,
|
|
|
|
|
"sex" => $request->patient_sex
|
|
|
|
|
]);
|
|
|
|
|
dd($patient);
|
|
|
|
|
|
|
|
|
|
$order = (new Orders())->create([
|
|
|
|
|
"customer_id" => $this->customer->id,
|
|
|
|
|
@ -380,8 +383,6 @@ class OrdersController extends CommonController
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
$order->getSerial();
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
|
|
DB::commit();
|
|
|
|
|
return $this->getOrder($order->id);
|
|
|
|
|
} catch (\Exception $exception) {
|
|
|
|
|
|