刘桂岩 3 年之前
父節點
當前提交
c3d94c986b
共有 1 個文件被更改,包括 2 次插入2 次删除
  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();