Explorar o código

Merge branch 'master' of http://git.9026.com/swdz-WangHaijun/BaoMa

ChenWuJie %!s(int64=4) %!d(string=hai) anos
pai
achega
a29132b7f5
Modificáronse 1 ficheiros con 7 adicións e 0 borrados
  1. 7 0
      app/Http/Controllers/Api/V1/OrderController.php

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

xqd xqd
@@ -8,6 +8,7 @@
 
 namespace App\Http\Controllers\Api\V1;
 
+use App\Models\DocterServiceTime;
 use App\Models\DocterSetting;
 use App\Models\Nurse;
 use App\Models\Order;
@@ -51,6 +52,12 @@ class OrderController extends AuthController
         ]);
         $user = $this->user;
 
+        //判断是否在服务时间内
+        $now_line = (int)date('Hi');
+        if (!DocterServiceTime::where('docter_id', $req['docter_id'])->where('type', $req['product_type'])->where('start_time_line', '<=', $now_line)->where('end_time_line', '>', $now_line)->exists()) {
+            return out(null, 10011, '当前不在医生服务时间内,不能下单');
+        }
+
         if (!empty($req['pay_password'])) {
             if (empty($user['pay_password'])) {
                 return out(null, 60010, '未设置支付密码');