From c07aa336768ac392026ea5f7e29564254b2e149c Mon Sep 17 00:00:00 2001 From: lyt Date: Thu, 27 Jun 2019 11:58:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=B0=E6=8E=A5=E8=AE=A1=E5=88=92:fixed?= =?UTF-8?q?=E5=AE=A2=E4=BA=BA=E5=B9=B4=E9=BE=84=E8=AE=A1=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webht/third_party/vendorPlanSync/helpers/array_helper.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webht/third_party/vendorPlanSync/helpers/array_helper.php b/webht/third_party/vendorPlanSync/helpers/array_helper.php index 2f6ec50f..7ec980a7 100644 --- a/webht/third_party/vendorPlanSync/helpers/array_helper.php +++ b/webht/third_party/vendorPlanSync/helpers/array_helper.php @@ -169,7 +169,7 @@ function real_phone_number($phone, $nation_code) function calc_age($birthday) { $now = new DateTime(); - $birth = new DateTime(strstr($birthday, " ", TRUE)); + $birth = new DateTime($birthday); $date_d = $now->diff($birth); $d_t = ($date_d->format("%y")); return $d_t; @@ -181,7 +181,7 @@ function calc_age_type($birthday) return 1; } $age = calc_age($birthday); - if ($age < 18) { + if ($age > 0 && $age < 18) { return 2; } return 1;