刘桂岩 4 years ago
parent
commit
a52a2f30e6
1 changed files with 11 additions and 11 deletions
  1. 11 11
      application/inter/controller/Application.php

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

@@ -48,7 +48,7 @@ class Application extends Base
      *")
      **/
     public function  index(){
-        try{
+//        try{
             $sessionid = $_REQUEST['sessionid'];
             $param = $_REQUEST['param'];
             $id = $param['id'];
@@ -66,13 +66,13 @@ class Application extends Base
             $info['exam_project_name'] = $exam_project['name'];
             $info['device_name'] = $device['name'];
             $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'];
-            $info['name'] = $patient_info['name'];
-            $info['sex'] = $patient_info['sex'];
-            $info['age'] = $patient_info['age'];
-            $info['phone'] = $patient_info['phone'];
-            if(!empty($patient_info['birthday'])){
+            $info['pid'] = $patient_info['id'] ?? null;
+            $info['temp_patient_id'] = $patient_info['temp_patient_id'] ?? null;
+            $info['name'] = $patient_info['name'] ?? null;
+            $info['sex'] = $patient_info['sex'] ?? null;
+            $info['age'] = $patient_info['age'] ?? null;
+            $info['phone'] = $patient_info['phone'] ?? null;
+            if(!empty($patient_info['birthday'] ?? null)){
                 $info['birthday'] = $patient_info['birthday'];
             }
             $doctor = Cache::get($sessionid);
@@ -255,9 +255,9 @@ class Application extends Base
             $count = DB::table('messages')->where('application_id',$aid)->where('doctor_id',$doctor['id'])->where('status',0)->where('type',7)->where('is_read',0)->field('count')->find();
             $info['unread_message_num'] = $count['count'];
             return json_encode(['status'=>'ok','code'=>'0000','info'=>$info,'sessionid'=>$sessionid,'is_remote'=>$is_remote,'rid'=>$aid]);
-        }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()]);
+//        }
     }
     /**取消订单 */
     public function cancel(WechatService $wechatService){