zilong 4 سال پیش
والد
کامیت
b64d67e9be
1فایلهای تغییر یافته به همراه8 افزوده شده و 1 حذف شده
  1. 8 1
      app/Community/Controllers/DocterChatController.php

+ 8 - 1
app/Community/Controllers/DocterChatController.php

xqd xqd
@@ -6,6 +6,7 @@ use App\Admin\Actions\Community\Docter\Chat;
 use App\Admin\Actions\Community\Notice\sendNotice;
 use App\Admin\Actions\Community\Order\Detail;
 use App\Models\Docter;
+use App\Models\DocterOrganization;
 use App\Models\Order;
 use Encore\Admin\Controllers\AdminController;
 use Encore\Admin\Facades\Admin;
@@ -50,7 +51,13 @@ class DocterChatController extends AdminController
             }
         }
 
-        $grid->model()->where($where);
+        if (empty($docter_id)) {
+            $docter_ids = DocterOrganization::where('organization_id', $org_id)->pluck('docter_id')->toArray();
+            $grid->model()->where($where)->whereIn('id', $docter_ids);
+        }
+        else {
+            $grid->model()->where($where);
+        }
 
         $grid->column('order_sn', __('订单号'));
         $grid->column('docter.name', __('医生'));