From 18b98ed21d79156c06ee8bf0436e8818f45a0f7d Mon Sep 17 00:00:00 2001 From: yanzai Date: Thu, 4 Sep 2025 09:55:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E6=8E=A8=E9=80=81=EF=BC=8C?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=9C=80=E6=96=B0=E6=8A=A5=E5=91=8Apdf,?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C=20=E5=81=A5=E5=BA=B7=E8=AF=8116=E5=B2=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/API/Admin/YeWu/PingTaiPushController.php | 5 ++++- Laravel/app/Services/Admin/YeWu/AppointmentService.php | 9 ++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Laravel/app/Http/Controllers/API/Admin/YeWu/PingTaiPushController.php b/Laravel/app/Http/Controllers/API/Admin/YeWu/PingTaiPushController.php index 2822e1a..aa9fff8 100644 --- a/Laravel/app/Http/Controllers/API/Admin/YeWu/PingTaiPushController.php +++ b/Laravel/app/Http/Controllers/API/Admin/YeWu/PingTaiPushController.php @@ -42,7 +42,10 @@ class PingTaiPushController extends Controller $list = $list->orderBy('created_at', 'desc')->skip(($page-1)*$pageSize)->take($pageSize)->get(); foreach ($list as $k => $v) { $list[$k]->pdf_url=null; - $pdf=DB::table('health_certificate_push_pdf')->where([ 'hospitalCode' => $v->hospitalCode,'healthExaminationId' => $v->healthExaminationId])->first(); + $pdf=DB::table('health_certificate_push_pdf') + ->where([ 'hospitalCode' => $v->hospitalCode,'healthExaminationId' => $v->healthExaminationId]) + ->orderBy('id', 'desc') + ->first(); if(!!$pdf){ $list[$k]->pdf_url=$pdf->pdf_url; } diff --git a/Laravel/app/Services/Admin/YeWu/AppointmentService.php b/Laravel/app/Services/Admin/YeWu/AppointmentService.php index e3af07a..a25ae6f 100644 --- a/Laravel/app/Services/Admin/YeWu/AppointmentService.php +++ b/Laravel/app/Services/Admin/YeWu/AppointmentService.php @@ -75,6 +75,9 @@ class AppointmentService //查询预约登记表 + if($type==1 and $this->isOver65($id_card_num,16)===false){ + return \Yz::echoError1("未满16周岁,禁止登记"); + } if($type==2 and $this->isOver65($id_card_num)===false){ return \Yz::echoError1("年龄不满足条件"); } @@ -209,7 +212,7 @@ class AppointmentService return $result; } - public function isOver65($idCard) { + public function isOver65($idCard,$ageLine=65) { // 从身份证号中提取出生日期 if(strlen($idCard)<>18) return false; $birthYear = substr($idCard, 6, 4); @@ -233,8 +236,8 @@ class AppointmentService $birthYear = intval($birthYear); $currentYear = intval($currentYear); $ageDiff= $currentYear - $birthYear; - // 判断年龄是否大于65岁 - if ($ageDiff >= 65) { + // 判断年龄是否大于设定年龄 + if ($ageDiff >= $ageLine) { return true; } else { return false;