diff --git a/app/Controller/TestController.php b/app/Controller/TestController.php index 567dcf9..a2af6aa 100644 --- a/app/Controller/TestController.php +++ b/app/Controller/TestController.php @@ -10,6 +10,7 @@ use App\Model\DoctorInquiryTime; use App\Model\DoctorPharmacistCert; use App\Model\OrderInquiry; use App\Model\OrderPrescription; +use App\Model\OrderPrescriptionIcd; use App\Model\UserDoctor; use App\Services\ImService; use App\Services\MessagePush; @@ -507,27 +508,24 @@ class TestController extends AbstractController } public function test_11(){ - $ca = new Ca(); - $prescription_pdf_result = $ca->getSignedFile("491925054435950592","1641368425758359554"); - if (empty($prescription_pdf_result)){ - throw new BusinessException("下载处方签章文件失败"); + // 获取处方关联疾病数据 + $params = array(); + $params['order_prescription_id'] = "500341310934036481"; + $order_prescription_icd = OrderPrescriptionIcd::getOne($params); + if (empty($order_prescription_icd)){ + throw new BusinessException("处方疾病数据错误"); } - $file = fopen("./runtime/test.pdf", "w") or die("Unable to open file!"); - fwrite($file, $prescription_pdf_result); - fclose($file); + dump($order_prescription_icd->toArray()); + // 处理疾病数据 + $icd_name = array_column($order_prescription_icd->toArray(),'icd_name'); + if (!empty($icd_name)){ + $icd_name = implode(';',$icd_name); + }else{ + $icd_name = ""; + } - // 将临时文件转换为图片 - $pdf = new Pdf("./runtime/test.pdf"); - $pdf->saveImage("./runtime/test.jpg"); - -// dump($prescription_pdf_result); -// -// $manager = new ImageManager(); -// $image = $manager->make($prescription_pdf_result)->convert('jpg'); -// -// // 保存图片 -// $image->save('./runtime/image.jpg'); + dump($icd_name); } } \ No newline at end of file diff --git a/app/Services/OrderPrescriptionService.php b/app/Services/OrderPrescriptionService.php index d92dbc1..73614de 100644 --- a/app/Services/OrderPrescriptionService.php +++ b/app/Services/OrderPrescriptionService.php @@ -166,7 +166,7 @@ class OrderPrescriptionService extends BaseService // 获取处方关联疾病数据 $params = array(); $params['order_prescription_id'] = $order_prescription_id; - $order_prescription_icd = OrderPrescriptionIcd::getOne($params); + $order_prescription_icd = OrderPrescriptionIcd::getList($params); if (empty($order_prescription_icd)){ throw new BusinessException("处方疾病数据错误"); }