zilong 4 years ago
parent
commit
7f4e9bbb54
1 changed files with 8 additions and 2 deletions
  1. 8 2
      app/Http/Controllers/Api/V1/DocterController.php

+ 8 - 2
app/Http/Controllers/Api/V1/DocterController.php

xqd
@@ -44,13 +44,19 @@ class DocterController extends AuthController
             $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) {
+        elseif ($list_type == 2) {
             $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) {
+        elseif ($list_type == 3) {
             $builder->where('is_appoint', 1);
         }
+        else {
+            $builder->where(function ($query) {
+                $query->where('is_phone', 1)->orWhere('is_chat', 1)->orWhere('is_appoint', 1);
+            });
+        }
+
         if (!empty($req['name'])) {
             $name = $req['name'];
             $organizations = Organization::with('docter')->select(['id'])->where('name', 'like', '%'.$name.'%')->get()->toArray();