平台推送,获取最新报告pdf,校验 健康证16岁

main
yanzai 3 months ago
parent 18cfc70616
commit 18b98ed21d

@ -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;
}

@ -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;

Loading…
Cancel
Save