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