zilong 4 years ago
parent
commit
5633bc1ba3
1 changed files with 4 additions and 5 deletions
  1. 4 5
      app/Http/Controllers/Api/V1/DocterController.php

+ 4 - 5
app/Http/Controllers/Api/V1/DocterController.php

xqd
@@ -42,13 +42,12 @@ class DocterController extends AuthController
         $list_type = !empty($req['list_type']) ? $req['list_type'] : 0;
         $now_line = (int)date('Hi');
         if ($list_type == 1) {
-            $ids = DocterServiceTime::where('type', 1)->where('start_time_line', '<=', $now_line)->where('end_time_line', '>', $now_line)->pluck('docter_id')->toArray();
-            $builder->where('is_phone', 1)->whereIn('id', $ids);
+            $docter_ids5 = DocterServiceTime::where('type', 1)->where('start_time_line', '<=', $now_line)->where('end_time_line', '>', $now_line)->pluck('docter_id')->toArray();
+            $builder->where('is_phone', 1)->whereIn('id', $docter_ids5);
         }
         if ($list_type == 2) {
-            $ids = DocterServiceTime::where('type', 2)->where('start_time_line', '<=', $now_line)->where('end_time_line', '>', $now_line)->pluck('docter_id')->toArray();
-            $builder->where('is_phone', 1)->whereIn('id', $ids);
-            $builder->where('is_chat', 1);
+            $docter_ids6 = DocterServiceTime::where('type', 2)->where('start_time_line', '<=', $now_line)->where('end_time_line', '>', $now_line)->pluck('docter_id')->toArray();
+            $builder->where('is_chat', 1)->whereIn('id', $docter_ids6);
         }
         if ($list_type == 3) {
             $builder->where('is_appoint', 1);