zilong 4 tahun lalu
induk
melakukan
7b1f91c1db

+ 3 - 3
app/Http/Controllers/Api/V1/OrderController.php

xqd xqd xqd
@@ -94,7 +94,7 @@ class OrderController extends AuthController
             $order_sn = build_sn($order['id']);
             Order::where('id', $order['id'])->update(['order_sn' => $order_sn]);
             //保存订单患者信息
-            $addPatient = Patient::select(['name', 'sex', 'avatar', 'birthday', 'relationship_type', 'info', 'card_type', 'card_number', 'card_img_url', 'card_back_img_url'])->where('id', $req['patient_id'])->first()->getOriginal();
+            $addPatient = Patient::select(['name', 'sex', 'avatar', 'birthday', 'relationship_type', 'info', 'card_type', 'card_number', 'card_img_url', 'card_back_img_url', 'email', 'phone as patient_phone', 'social_card_number', 'born_hospital', 'guardian_name', 'address'])->where('id', $req['patient_id'])->first()->getOriginal();
             $addPatient['order_id'] = $order['id'];
             $addPatient['patient_id'] = $req['patient_id'];
             if ($req['product_type'] == 1) {
@@ -240,7 +240,7 @@ class OrderController extends AuthController
             $order_sn = build_sn($order['id']);
             Order::where('id', $order['id'])->update(['order_sn' => $order_sn]);
             //保存订单患者信息
-            $addPatient = Patient::select(['name', 'sex', 'avatar', 'birthday', 'relationship_type', 'info', 'card_type', 'card_number', 'card_img_url', 'card_back_img_url'])->where('id', $req['patient_id'])->first()->getOriginal();
+            $addPatient = Patient::select(['name', 'sex', 'avatar', 'birthday', 'relationship_type', 'info', 'card_type', 'card_number', 'card_img_url', 'card_back_img_url', 'email', 'phone as patient_phone', 'social_card_number', 'born_hospital', 'guardian_name', 'address'])->where('id', $req['patient_id'])->first()->getOriginal();
             $addPatient['order_id'] = $order['id'];
             $addPatient['patient_id'] = $req['patient_id'];
             $addPatient['organization_id'] = $req['organization_id'];
@@ -349,7 +349,7 @@ class OrderController extends AuthController
             $discount_amount = UserCoupon::getDiscountAmount($req['user_coupon_id'], $user['id'], $req['total_amount'], 6);
         }
 
-        $addPatient = Patient::select(['name', 'sex', 'avatar', 'birthday', 'relationship_type', 'info', 'card_type', 'card_number', 'card_img_url', 'card_back_img_url'])->where('id', $req['patient_id'])->first()->getOriginal();
+        $addPatient = Patient::select(['name', 'sex', 'avatar', 'birthday', 'relationship_type', 'info', 'card_type', 'card_number', 'card_img_url', 'card_back_img_url', 'email', 'phone as patient_phone', 'social_card_number', 'born_hospital', 'guardian_name', 'address'])->where('id', $req['patient_id'])->first()->getOriginal();
         if (empty($addPatient['card_img_url'])) {
             return out(null, 70011, '该患者未上传身份证');
         }

+ 12 - 0
app/Http/Controllers/Api/V1/PatientController.php

xqd xqd
@@ -25,6 +25,12 @@ class PatientController extends AuthController
             'info' => 'max:1000',
             'card_type' => 'in:0,1,2',
             'card_number' => 'max:50',
+            'email' => 'required|email',
+            'phone' => 'required',
+            'guardian_name' => 'required',
+            'address' => 'required',
+            'born_hospital' => 'required',
+            'social_card_number' => 'max:50',
         ]);
         $user = $this->user;
 
@@ -47,6 +53,12 @@ class PatientController extends AuthController
             'info' => 'max:1000',
             'card_type' => 'in:0,1,2',
             'card_number' => 'max:50',
+            'email' => 'required|email',
+            'phone' => 'required',
+            'guardian_name' => 'required',
+            'address' => 'required',
+            'born_hospital' => 'required',
+            'social_card_number' => 'max:50',
         ]);
         $user = $this->user;
 

+ 1 - 1
app/Models/Patient.php

xqd
@@ -30,7 +30,7 @@ class Patient extends BaseModel
 
     public function getPerfectdDegreeAttribute()
     {
-        $field = ['name', 'sex', 'avatar', 'birthday', 'relationship_type', 'card_number'];
+        $field = ['name', 'sex', 'avatar', 'birthday', 'relationship_type', 'card_number', 'email', 'phone', 'social_card_number', 'born_hospital', 'guardian_name', 'address'];
         $total = count($field);
         $fill = 0;
         foreach ($field as $k => $v) {