刘桂岩 5 years ago
parent
commit
3ea45d3a4a
1 changed files with 11 additions and 6 deletions
  1. 11 6
      application/inter/controller/Application.php

+ 11 - 6
application/inter/controller/Application.php

@@ -56,15 +56,20 @@ class Application extends Base
             if(isset($_REQUEST['is_remote']) && $_REQUEST['is_remote']==1){
                 $is_remote = 1;
             }
-            $info = DB::table('exams')->where('id',$id)->field('id,urgent,study_id,patient_id,register_datetime,exam_class,exam_sub_class,exam_project,device,exam_datetime,exam_status')->find();
+            $info = DB::table('exams')->where('id',$id)->field('id,urgent,study_id,patient_id,exam_class,exam_sub_class,exam_project,device_name as device,exam_datetime,exam_status')->find();
             $exam_class = DB::table('constant')->where('id',$info['exam_class'])->field('constant_value')->find();
-            $exam_subclass = DB::table('exam_subclass')->where('id',$info['exam_sub_class'])->cache(300)->find();
-            $exam_project = DB::table('exam_project')->where('id',$info['exam_project'])->cache(300)->find();
-            $device = DB::table('device')->where('id',$info['device'])->cache(300)->find();
+            $exam_subclass = DB::table('exam_subclass')->where('id',$info['exam_sub_class'])->find();
+            $exam_project = DB::table('exam_project')->where('id',$info['exam_project'])->find();
+            $device = DB::table('device')->where('id',$info['device'])->find();
+            if(empty($device)){
+                $deviceName = $info['device'];
+            }else{
+                $deviceName = $device['name'];
+            }
             $info['exam_class_name'] = $exam_class['constant_value'];
             $info['exam_subclass_name'] = $exam_subclass['name'];
             $info['exam_project_name'] = $exam_project['name'];
-            $info['device_name'] = $device['name'];
+            $info['device_name'] = $deviceName;
             $patient_info = DB::table('patient_infos')->where('id',$info['patient_id'])->field(['temp_patient_id','id','name','sex','age','birthday', 'phone'])->find();
             $info['pid'] = $patient_info['id'];
             $info['temp_patient_id'] = $patient_info['temp_patient_id'];
@@ -173,7 +178,7 @@ class Application extends Base
             } else {
                 $parent_hosp = explode(',',$hospital['parent_institution']);
                 foreach($parent_hosp as $v){
-                    $phname = DB::table("institution")->where('id',$v)->cache(300)->field(['id','name'])->find();
+                    $phname = DB::table("institution")->where('id',$v)->field(['id','name'])->find();
                     log::record('上级医院----'.json_encode($phname));
                     if(!isset($phname['id']) || empty($phname['id'])){
                         $phname['id'] = $v;