刘桂岩 3 lat temu
rodzic
commit
c3d94c986b
1 zmienionych plików z 2 dodań i 2 usunięć
  1. 2 2
      application/manage/controller/Doctors.php

+ 2 - 2
application/manage/controller/Doctors.php

@@ -45,9 +45,9 @@ class Doctors extends Base {
         $info = DB::table('doctors')->where($whereArr)->page($page, $pagesize)->select();
         foreach ($info as $k => $v) {
             $iname = DB::table('institution')->where('id', $v['institution_id'])->field('name')->find();
-            $info[$k]['institution_name'] = $iname['name'];
+            $info[$k]['institution_name'] = $iname['name'] ?? null;
             $dname = DB::table('department')->where('id', $v['department_id'])->field('department_name')->find();
-            $info[$k]['department_name'] = $dname['department_name'];
+            $info[$k]['department_name'] = $dname['department_name'] ?? null;
         }
         $num = DB::table('doctors')->where($whereArr)->count();
         $data = array();