|
|
|
|
@ -358,18 +358,17 @@ class OrdersController extends CommonController
|
|
|
|
|
$factors = (new Orders())->requestFactorsToOrderFactors();
|
|
|
|
|
$price += collect($factors)->sum("price");
|
|
|
|
|
|
|
|
|
|
// $patient = Patient::firstOrCreate([
|
|
|
|
|
// "customer_id" => $this->customer->id,
|
|
|
|
|
// "name" => $request->patient_name,
|
|
|
|
|
// "sex" => $request->patient_sex
|
|
|
|
|
// ]);
|
|
|
|
|
// dd($patient);
|
|
|
|
|
$patient = Patient::firstOrCreate([
|
|
|
|
|
"customer_id" => $this->customer->id,
|
|
|
|
|
"name" => $request->patient_name,
|
|
|
|
|
"sex" => $request->patient_sex
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
$order = (new Orders())->create([
|
|
|
|
|
"customer_id" => $this->customer->id,
|
|
|
|
|
"project_id" => $product->project_id,
|
|
|
|
|
"product_id" => $request->product_id,
|
|
|
|
|
//"patient_id" => $patient->id,
|
|
|
|
|
"patient_id" => $patient->id,
|
|
|
|
|
"contact" => $request->contact,
|
|
|
|
|
"mobile" => $request->mobile,
|
|
|
|
|
"from_date" => $request->from_date,
|
|
|
|
|
|