|
|
@ -1190,15 +1190,15 @@ function age_verify($cardno, $name)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$date = age($cardno, $name);
|
|
|
|
$date = age($cardno, $name);
|
|
|
|
|
|
|
|
|
|
|
|
if ($date['resp']['code'] == 0 && $date > 0) {
|
|
|
|
if ($date['status'] == "01") {
|
|
|
|
$age = floor((time() - strtotime($date['data']['birthday'])) / (60 * 60 * 24 * 365));
|
|
|
|
$age = floor((time() - strtotime($date['data']['birthday'])) / (60 * 60 * 24 * 365));
|
|
|
|
if ($age > 17) {
|
|
|
|
if ($age > 17) {
|
|
|
|
return 1;
|
|
|
|
return 1;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
return 2;
|
|
|
|
return 2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} elseif ($date['resp']['code'] != 0 && $date > 0) {
|
|
|
|
} elseif ($date['status'] > 200) {
|
|
|
|
return 0;
|
|
|
|
return -2;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
return $date;
|
|
|
|
return $date;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1211,6 +1211,7 @@ function age($cardno, $name)
|
|
|
|
$path = "/idCardCert";
|
|
|
|
$path = "/idCardCert";
|
|
|
|
$method = "GET";
|
|
|
|
$method = "GET";
|
|
|
|
$appcode = C('tool_age.appcode');
|
|
|
|
$appcode = C('tool_age.appcode');
|
|
|
|
|
|
|
|
// $appcode = "244181f0846541a19e24df409736d3b9";
|
|
|
|
$headers = array();
|
|
|
|
$headers = array();
|
|
|
|
array_push($headers, "Authorization:APPCODE " . $appcode);
|
|
|
|
array_push($headers, "Authorization:APPCODE " . $appcode);
|
|
|
|
$querys = "idCard=" . $cardno . "&name=" . $name;
|
|
|
|
$querys = "idCard=" . $cardno . "&name=" . $name;
|
|
|
@ -1231,15 +1232,22 @@ function age($cardno, $name)
|
|
|
|
if (empty($output)) {
|
|
|
|
if (empty($output)) {
|
|
|
|
return -1;//用完
|
|
|
|
return -1;//用完
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (curl_getinfo($curl, CURLINFO_HTTP_CODE) == '200') {
|
|
|
|
|
|
|
|
$headersize = curl_getinfo($curl, CURLINFO_HEADER_SIZE);
|
|
|
|
$r = json_decode($output, true);
|
|
|
|
$header = substr($output, 0, $headersize);
|
|
|
|
if ($r['status'] == "02") return 0;
|
|
|
|
$body = substr($output, $headersize);
|
|
|
|
return $r;
|
|
|
|
curl_close($curl);
|
|
|
|
// if (empty($output)) {
|
|
|
|
return json_decode($body, true);
|
|
|
|
// return -1;//用完
|
|
|
|
} else {
|
|
|
|
// }
|
|
|
|
return -2;//失败
|
|
|
|
// if (curl_getinfo($curl, CURLINFO_HTTP_CODE) == '200') {
|
|
|
|
}
|
|
|
|
// $headersize = curl_getinfo($curl, CURLINFO_HEADER_SIZE);
|
|
|
|
|
|
|
|
// $header = substr($output, 0, $headersize);
|
|
|
|
|
|
|
|
// $body = substr($output, $headersize);
|
|
|
|
|
|
|
|
// curl_close($curl);
|
|
|
|
|
|
|
|
// return json_decode($body, true);
|
|
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
|
|
// return -2;//失败
|
|
|
|
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*短信发送验证限制条件 */
|
|
|
|
/*短信发送验证限制条件 */
|
|
|
|