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;