zilong hace 4 años
padre
commit
b96db0c672
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      app/Community/Controllers/NoticeManageController.php

+ 2 - 1
app/Community/Controllers/NoticeManageController.php

xqd
@@ -25,7 +25,8 @@ class NoticeManageController extends AdminController
         $req = request()->query();
         $user = Admin::user();
 
-        $builder = Patient::orderBy('id', 'desc');
+        $patient_ids = Order::where('organization_id', $user['org_id'])->pluck('patient_id')->toArray();
+        $builder = Patient::whereIn('id', $patient_ids)->orderBy('id', 'desc');
         if (!empty($req['user'])) {
             $userIds = User::where('nickname', 'like', '%'.$req['user'].'%')->pluck('id')->toArray();
             $builder->whereIn('user_id', $userIds);