Browse Source

Merge branch 'pro' of http://code.pacsonline.cn/zskk_bg/yuanchengpasc into pro

fuyu 5 years ago
parent
commit
a68a53398e

+ 1 - 1
application/index/controller/Index.php

@@ -19,7 +19,7 @@ class Index extends Controller
     }
     public function get_studiesinfo(){
         $study_id = $_REQUEST['study_id'];
-        /*if(isset($_REQUEST['address']) && !empty($_REQUEST['address'])){
+        /*if(isset($_REQUEST['address']) && !empty($_   REQUEST['address'])){
             $url = "dicomweb://".$_REQUEST['address']."/";
         }else{
             $url = '';

+ 15 - 5
application/inter/controller/Inspectregister.php

@@ -47,10 +47,10 @@ class Inspectregister extends Base
             $doctor = Cache::get($sessionid);
             $info = array();
             // 科室
-            $department = DB::table('department')->where('institution_id',$doctor['institution_id'])->cache(300)->field('id','department_name')->select();
+            $department = DB::table('department')->where('institution_id',$doctor['institution_id'])->field('id','department_name')->select();
             $info['department'] = $department;
             // 机构
-            $doctor_department = DB::table('department')->where('id',$doctor['department_id'])->cache(300)->field('id,department_name')->find();
+            $doctor_department = DB::table('department')->where('id',$doctor['department_id'])->field('id,department_name')->find();
             $info['execute_department'] = $doctor_department;
             log::record('--------返回信息-----------------');
             log::record($info);
@@ -288,10 +288,17 @@ class Inspectregister extends Base
     public function department(){
         $sessionid = $_REQUEST['sessionid'];
         $doctor = Cache::get($sessionid);
-        $department = DB::table('department')->where('is_report',1)->where('institution_id',$doctor['institution_id'])->cache(300)->select();
+        $department = DB::table('department')->where('institution_id',$doctor['institution_id'])->field('id,department_name')->select();
         return json_encode(['status'=>'ok','code'=>'0000','info'=>$department]);
     }
 
+    public function doctors()
+    {
+        $param = $_REQUEST['param'];
+        $doctor = DB::table('doctors')->where('department_id',$param['id'])->field('realname')->select();
+        return $doctor;
+    }
+
     /**
      *  预约登记保存
      *
@@ -378,9 +385,9 @@ class Inspectregister extends Base
             }
             if(isset($param['exam_id']) && !empty($param['exam_id'])){
                 $pid = DB::table('exams')->where('id',$param['exam_id'])->field('patient_id,exam_status')->find();
-                if($pid['exam_status'] >= 3){
+                /*if($pid['exam_status'] >= 3){
                     return json_encode(['status'=>'fail','code'=>'1130','msg'=>'已经检查完毕,不允许在此修改']);
-                }
+                }*/
                 //存在并且有值 则修改
                 $patient = DB::table('patient_infos')->where('temp_patient_id',$pid['patient_id'])->update($patient_info);
             }else{
@@ -420,6 +427,8 @@ class Inspectregister extends Base
             $exam_info['clin_diag']          = isset($param['clin_diag']) ? $param['clin_diag'] : '';
             $exam_info['register'] = $doctor['id'];
             $exam_info['createdAt'] = date('Y-m-d H:i:s',time());
+            $exam_info['application_department'] = isset($param['application_department']) ? $param['application_department'] : '';
+            $exam_info['application_doctor'] = isset($param['application_doctor']) ? $param['application_doctor'] : '';
             if(isset($param['exam_id']) && !empty($param['exam_id'])){
                 $exam = DB::table('exams')->where('id',$param['exam_id'])->update($exam_info);
             }else{
@@ -597,4 +606,5 @@ class Inspectregister extends Base
         $illness = DB::table('constant')->where('parent_id','illness')->cache(300)->field('constant_key,constant_value')->select();
         return json_encode(['status'=>'ok','code'=>'0000','info'=>$illness]);
     }
+
 }

+ 9 - 4
application/inter/controller/license.php

@@ -12,7 +12,7 @@ use app\common\library\Verify;
 use think\Validate;
 use app\common\library\send_message;
 
-class License extends Controller
+class License extends Controller 
 {
     public function _initialize(){
         /*$admin = Cache::get('doctor');
@@ -54,14 +54,18 @@ class License extends Controller
         try{
             $param = $_REQUEST['param'];
             $license = $param['license'] ??  false;
-            if(!$license || $license != '116c7413be204bf3') { //依据授权码 73090026
+            Log::record("$license");
+            Log::record($license);
+            $license_info = Db::table('license')->where('license', $license)->where('status',1)->find();
+            Log::record($license_info);
+            if(empty($license_info)) {
                 return json_encode(['status'=>'fail','code'=>'2001','msg'=>'授权码校验失败']);
             }
-            $sessionid = '116c73e78496739b';
+            $info = Db::table('doctors')->where('id', $license_info['uid'])->find();
+            $sessionid = (time()+86400).rand(0,1000);
             log::record($sessionid);
             log::record($_REQUEST);
             //医生信息
-            $info = DB::table('doctors')->where('username', '73090026')->field('is_send_message,is_admin,message_push,id,exam_class,attachment,username,password,login_time,login_failure,realname,email,phone,doctor_title,institution_id,department_id,doctor_role,is_report')->find();
             log::record($info);
             if(!$info){
                 return json_encode(['status'=>'fail','code'=>'1004','msg'=>'用户名信息不存在']);
@@ -84,6 +88,7 @@ class License extends Controller
             return json_encode(['status'=>'ok','code'=>'0000','info'=>$info,'sessionid'=>$sessionid]);
 
         }catch(\Exception $e){
+            Log::record(2);
             return json_encode(['status'=>'fail','code'=>'2000','msg'=>$e->getMessage()]);
         }
     }