zilong há 4 anos atrás
pai
commit
d5149c796a

+ 1 - 2
app/Http/Controllers/Api/V1/CouponController.php

xqd
@@ -32,8 +32,7 @@ class CouponController extends AuthController
             return out(null, 10001, '您已经领取过该优惠券了');
         }
 
-        $add = Coupon::select(['id as coupon_id', 'name', 'title', 'desc', 'rules', 'icon', 'type', 'usable_type', 'money', 'discount', 'min_consume_amount', 'max_reduce_amount', 'expire_type', 'effective_days', 'start_time', 'end_time'])->where('id', $req['coupon_id'])->first()->toArray();
-        unset($add['is_receive']);
+        $add = Coupon::select(['id as coupon_id', 'name', 'title', 'desc', 'rules', 'icon', 'type', 'usable_type', 'money', 'discount', 'min_consume_amount', 'max_reduce_amount', 'expire_type', 'effective_days', 'start_time', 'end_time'])->where('id', $req['coupon_id'])->first()->getOriginal();
         $add['user_id'] = $user['id'];
         $expire_time = $add['end_time'];
         if ($add['expire_type'] == 1) {

+ 6 - 9
app/Http/Controllers/Api/V1/OrderController.php

xqd xqd xqd xqd xqd xqd
@@ -89,7 +89,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'])->where('id', $req['patient_id'])->first()->toArray();
+            $addPatient = Patient::select(['name', 'sex', 'avatar', 'birthday', 'relationship_type', 'info', 'card_type', 'card_number'])->where('id', $req['patient_id'])->first()->getOriginal();
             $addPatient['order_id'] = $order['id'];
             $addPatient['patient_id'] = $req['patient_id'];
             if ($req['product_type'] == 1) {
@@ -100,7 +100,6 @@ class OrderController extends AuthController
                 $addPatient['symptoms'] = $req['symptoms'];
                 $addPatient['medical_imgs'] = $req['medical_imgs'];
             }
-            unset($addPatient['age']);
             OrderPatient::create($addPatient);
 
             //判断是微信支付
@@ -229,7 +228,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'])->where('id', $req['patient_id'])->first()->toArray();
+            $addPatient = Patient::select(['name', 'sex', 'avatar', 'birthday', 'relationship_type', 'info', 'card_type', 'card_number'])->where('id', $req['patient_id'])->first()->getOriginal();
             $addPatient['order_id'] = $order['id'];
             $addPatient['patient_id'] = $req['patient_id'];
             $addPatient['organization_id'] = $req['organization_id'];
@@ -237,11 +236,10 @@ class OrderController extends AuthController
             $timePeriod = TimePeriod::where('id', $req['time_period_id'])->first();
             $addPatient['appoint_start_time'] = strtotime($req['schedule_date'].' '.$timePeriod['start_time_period'].':00');
             $addPatient['appoint_end_time'] = strtotime($req['schedule_date'].' '.$timePeriod['end_time_period'].':00');
-            unset($addPatient['age']);
             $orderPatient = OrderPatient::create($addPatient);
             //保存订单疫苗信息
             if ($req['product_type'] == 4) {
-                $addVaccine = Vaccine::select(['id as vaccine_id', 'type as vaccine_type', 'price as vaccine_price', 'name as vaccine_name', 'remark as vaccine_remark', 'supplier as vaccine_supplier'])->where('id', $req['vaccine_id'])->first()->toArray();
+                $addVaccine = Vaccine::select(['id as vaccine_id', 'type as vaccine_type', 'price as vaccine_price', 'name as vaccine_name', 'remark as vaccine_remark', 'supplier as vaccine_supplier'])->where('id', $req['vaccine_id'])->first()->getOriginal();
                 $addVaccine['order_id'] = $order['id'];
                 $addVaccine['order_patient_id'] = $orderPatient['id'];
                 OrderVaccine::create($addVaccine);
@@ -250,7 +248,7 @@ class OrderController extends AuthController
             if ($req['product_type'] == 5) {
                 $nurse_ids = json_decode($req['nurse_ids'], true);
                 foreach ($nurse_ids as $k => $v) {
-                    $addNurse = Nurse::select(['id as nurse_id', 'price as nurse_price', 'name as nurse_name', 'remark as nurse_remark'])->where('id', $v)->first()->toArray();
+                    $addNurse = Nurse::select(['id as nurse_id', 'price as nurse_price', 'name as nurse_name', 'remark as nurse_remark'])->where('id', $v)->first()->getOriginal();
                     $addNurse['order_id'] = $order['id'];
                     $addNurse['order_patient_id'] = $orderPatient['id'];
                     OrderNurse::create($addNurse);
@@ -367,13 +365,12 @@ 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'])->where('id', $req['patient_id'])->first()->toArray();
+            $addPatient = Patient::select(['name', 'sex', 'avatar', 'birthday', 'relationship_type', 'info', 'card_type', 'card_number'])->where('id', $req['patient_id'])->first()->getOriginal();
             $addPatient['order_id'] = $order['id'];
             $addPatient['patient_id'] = $req['patient_id'];
-            unset($addPatient['age']);
             OrderPatient::create($addPatient);
             //保存订单服务包表
-            $addPack = ServicePack::select(['id as service_pack_id', 'name as pack_name', 'intro as pack_intro', 'price as pack_price', 'insurance_policy', 'team_id', 'phone_minutes', 'chat_num', 'appoint_num', 'vaccine_limit_amount', 'nurses_limit_amount', 'effective_days'])->where('id', $req['service_pack_id'])->first()->toArray();
+            $addPack = ServicePack::select(['id as service_pack_id', 'name as pack_name', 'intro as pack_intro', 'price as pack_price', 'insurance_policy', 'team_id', 'phone_minutes', 'chat_num', 'appoint_num', 'vaccine_limit_amount', 'nurses_limit_amount', 'effective_days'])->where('id', $req['service_pack_id'])->first()->getOriginal();
             $addPack['order_id'] = $order['id'];
             $addPack['is_security'] = $req['is_security'];
             $addPack['guardian_name'] = $req['guardian_name'];