刘桂岩 4 éve
szülő
commit
191dda23fb

+ 7 - 7
application/inter/controller/Application.php

@@ -197,10 +197,10 @@ class Application extends Base
             }else{
                 $rid = '';
                 $application = DB::table('remote_application')->where('exam_id',$id)->field(['id,remote_institution_id,report_status,id,remote_doctor_id','application_desc','attachment','req_doctor_id','illness_desc','phys_sign','clin_symp','is_urgent','anamnesis','family_ill','remark','clin_diag'])->find();
-                $aid = $application['id'];
+                $aid = $application['id'] ?? null;
             }
             $remote_order =  DB::table('remote_order')
-                ->where('application_id', $application['id'])
+                ->where('application_id', $application['id'] ?? null)
                 ->where('status', 'neq', self::ORDER_STATUS['CANCEL'])
                 ->where('status', 'neq', self::ORDER_STATUS['REDUCE'])
                 ->field('id, status, exam_class, super_hospital_id, super_doctor_id')
@@ -211,14 +211,14 @@ class Application extends Base
             if($is_remote == 1){
                 Message::read($doctor['id'],$aid,1);
                 //远程申请点击进入
-                $dinfo = DB::table('doctors')->where('id',$application['req_doctor_id'])->field('department_id')->find();
-                $dep = DB::table('department')->where('id',$dinfo['department_id'])->field('department_name')->find();
+                $dinfo = DB::table('doctors')->where('id',$application['req_doctor_id'] ?? null)->field('department_id')->find();
+                $dep = DB::table('department')->where('id',$dinfo['department_id'] ?? null)->field('department_name')->find();
             }else{
                 Message::read($doctor['id'],$aid,2);
                 //本地远程申请中
-                $dep = DB::table('department')->where('id',$doctor['department_id'])->field('department_name')->find();
+                $dep = DB::table('department')->where('id',$doctor['department_id'] ?? null)->field('department_name')->find();
             }
-            $info['department_name'] = $dep['department_name'];
+            $info['department_name'] = $dep['department_name'] ?? null;
             if(empty($application)){
                 $exam_application = DB::table('exams')->where('id',$id)->field(['illness_desc','phys_sign','clin_symp','remark','clin_diag','anamnesis','family_ill'])->find();
                 if(empty($exam_application['anamnesis'])){
@@ -239,7 +239,7 @@ class Application extends Base
                 $remote_name = DB::table('doctors')->where('id',$application['remote_doctor_id'])->field('realname')->find();
                 $remote_institution = DB::table('institution')->where('id',$application['remote_institution_id'])->value('name');
                 $application['remote_institution'] = $remote_institution;
-                $application['remote_doctor'] = $remote_name['realname'];
+                $application['remote_doctor'] = $remote_name['realname'] ?? null;
                 if(empty($application['anamnesis'])){
                     $application['anamnesis'] = '';
                 }else{

+ 13 - 13
application/inter/controller/Writereport.php

@@ -47,7 +47,7 @@ class Writereport extends Base
      *")
      **/
     public function  index(){
-        try{
+//        try{
             log::record('-----请求值-----');
             log::record($_REQUEST);
             log::record('-----请求值-----');
@@ -94,16 +94,16 @@ class Writereport extends Base
                 $info['remote'] = 2;
             }
             $report_doctor = DB::table('doctors')->where('id',$report['report_doctor_id'])->field('realname')->find();
-            $info['report_doctor'] = $report_doctor['realname'];
-            $info['report_datetime'] = $report['report_datetime'];
+            $info['report_doctor'] = $report_doctor['realname'] ?? null;
+            $info['report_datetime'] = $report['report_datetime'] ?? null;
             $review_doctor = DB::table('doctors')->where('id',$report['review_doctor_id'])->field('realname')->find();
-            $info['review_doctor'] = $review_doctor['realname'];
-            $info['review_datetime'] = $report['review_datetime'];
-            $info['description'] = $report['description'];
-            $info['impression'] = $report['impression'];
-            $info['report_result'] = $report['report_result'];
-            $info['report_id'] = $report['id'];
-            $info['qr_code'] = $report['qr_code'];
+            $info['review_doctor'] = $review_doctor['realname'] ?? null;
+            $info['review_datetime'] = $report['review_datetime'] ?? null;
+            $info['description'] = $report['description'] ?? null;
+            $info['impression'] = $report['impression'] ?? null;
+            $info['report_result'] = $report['report_result'] ?? null;
+            $info['report_id'] = $report['id'] ?? null;
+            $info['qr_code'] = $report['qr_code'] ?? null;
             $cache_key = $doctor['id'].'_'.$report['id'];
             if(Cache::get($cache_key)){
                 $cache = Cache::get($cache_key);
@@ -119,9 +119,9 @@ class Writereport extends Base
                 $info['bed_no']    = isset($cache['bed_no']) ? $cache['bed_no'] : '';
             }
             return json_encode(['status'=>'ok','code'=>'0000','info'=>$info,'sessionid'=>$sessionid,'is_remote'=>$is_remote]);
-        }catch(\Exception $e){
-            return json_encode(['status'=>'fail','code'=>'2000','msg'=>$e->getMessage()]);
-        }
+//        }catch(\Exception $e){
+//            return json_encode(['status'=>'fail','code'=>'2000','msg'=>$e->getMessage()]);
+//        }
     }
     /**
      * 上远程申请附件