zilong 4 năm trước cách đây
mục cha
commit
cddcb204f7

+ 20 - 0
app/Http/Controllers/Api/V1/CouponController.php

xqd
@@ -0,0 +1,20 @@
+<?php
+/**
+ * Created by PhpStorm.
+ * User: zilongs
+ * Date: 20-10-24
+ * Time: 上午11:14
+ */
+
+namespace App\Http\Controllers\Api\V1;
+
+use App\Models\Coupon;
+
+class CouponController extends AuthController
+{
+    public function couponList()
+    {
+        $data = Coupon::orderBy('id', 'desc')->paginate();
+        return out($data);
+    }
+}

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

xqd xqd xqd
@@ -95,6 +95,7 @@ class OrderController extends AuthController
                 $addPatient['symptoms'] = $req['symptoms'];
                 $addPatient['medical_imgs'] = $req['medical_imgs'];
             }
+            unset($addPatient['age']);
             OrderPatient::create($addPatient);
 
             //判断是微信支付
@@ -226,6 +227,7 @@ 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) {
@@ -354,6 +356,7 @@ class OrderController extends AuthController
             $addPatient = Patient::select(['name', 'sex', 'avatar', 'birthday', 'relationship_type', 'info', 'card_type', 'card_number'])->where('id', $req['patient_id'])->first()->toArray();
             $addPatient['order_id'] = $order['id'];
             $addPatient['patient_id'] = $req['patient_id'];
+            unset($addPatient['age']);
             OrderPatient::create($addPatient);
             //保存订单服务包表
             $addPack = ServicePack::select(['id service_pack_id', 'name pack_name', 'intro pack_intro', 'price pack_price', 'team_id', 'phone_minutes', 'chat_num', 'appoint_num', 'vaccine_limit_amount', 'nurses_limit_amount', 'effective_days'])->where('id', $req['service_pack_id'])->first()->toArray();

+ 9 - 0
app/Http/Controllers/Api/V1/UserController.php

xqd
@@ -82,4 +82,13 @@ class UserController extends AuthController
 
         return out($data);
     }
+
+    public function userCouponList()
+    {
+        $user = $this->user;
+
+        $data = UserCoupon::where('user_id', $user['id'])->where('status', 1)->where('expire_time', '>', time())->paginate();
+
+        return out($data);
+    }
 }

+ 14 - 0
app/Models/Coupon.php

xqd
@@ -0,0 +1,14 @@
+<?php
+/**
+ * Created by PhpStorm.
+ * User: zilongs
+ * Date: 20-10-24
+ * Time: 上午11:16
+ */
+
+namespace App\Models;
+
+class Coupon extends BaseModel
+{
+
+}