lgy 3 weeks ago
parent
commit
f32bcecdd5
1 changed files with 9 additions and 2 deletions
  1. 9 2
      jcjyhr/app/zskk/servies/PatientServies.php

+ 9 - 2
jcjyhr/app/zskk/servies/PatientServies.php

@@ -11,6 +11,7 @@ use think\db\exception\DataNotFoundException;
 use think\db\exception\DbException;
 use think\db\exception\DbException;
 use think\db\exception\ModelNotFoundException;
 use think\db\exception\ModelNotFoundException;
 use think\Exception;
 use think\Exception;
+use think\facade\Cache;
 use think\facade\Config;
 use think\facade\Config;
 use think\facade\Log;
 use think\facade\Log;
 use Throwable;
 use Throwable;
@@ -784,7 +785,7 @@ class PatientServies
             return [];
             return [];
         }
         }
         $patient = $patient->toArray();
         $patient = $patient->toArray();
-        $medical = $this->patientModel->getMedical($patient['PATIENT_CODE'],[]);
+        $medical = $this->patientModel->getMedical($patient['PATIENT_CODE'],$medicalWhere);
         if(empty($medical))
         if(empty($medical))
         {
         {
             return [];
             return [];
@@ -990,7 +991,7 @@ class PatientServies
                 }
                 }
                 $report->save($EXAM_REPORTS);
                 $report->save($EXAM_REPORTS);
                 $patient = $this->patientModel->where('PATIENT_CODE',$information['PATIENT_CODE'])->find();
                 $patient = $this->patientModel->where('PATIENT_CODE',$information['PATIENT_CODE'])->find();
-                $this->sendYqSms($patient['PHONE'],$patient['ID_CARD_NUM'],$information['ORGNAME']);
+//                $this->sendYqSms($patient['PHONE'],$patient['ID_CARD_NUM'],$information['ORGNAME']);
             }
             }
         }else{
         }else{
             log::record('报告请求失败,失败原因,hosempi为空,失败参数:'.json_encode($params));
             log::record('报告请求失败,失败原因,hosempi为空,失败参数:'.json_encode($params));
@@ -1006,6 +1007,12 @@ class PatientServies
             return '';
             return '';
         }else{
         }else{
             log::record('可以发送短信');
             log::record('可以发送短信');
+            $key = $phone.$idcard;
+            if(Cache::get($key))
+            {
+                return '存在发送记录';
+            }
+            Cache::set($key,1,86400);
             $url = "https://risserver3.pacsonline.cn/sendYqSms?phone=$phone&institution=$institution&idcard=$idcard";
             $url = "https://risserver3.pacsonline.cn/sendYqSms?phone=$phone&institution=$institution&idcard=$idcard";
             log::record('短信请求链接地址'.$url);
             log::record('短信请求链接地址'.$url);
             $return = $this->curl_get($url);
             $return = $this->curl_get($url);