|
|
|
@ -1190,15 +1190,15 @@ function age_verify($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));
|
|
|
|
|
if ($age > 17) {
|
|
|
|
|
return 1;
|
|
|
|
|
} else {
|
|
|
|
|
return 2;
|
|
|
|
|
}
|
|
|
|
|
} elseif ($date['resp']['code'] != 0 && $date > 0) {
|
|
|
|
|
return 0;
|
|
|
|
|
} elseif ($date['status'] > 200) {
|
|
|
|
|
return -2;
|
|
|
|
|
} else {
|
|
|
|
|
return $date;
|
|
|
|
|
}
|
|
|
|
@ -1211,6 +1211,7 @@ function age($cardno, $name)
|
|
|
|
|
$path = "/idCardCert";
|
|
|
|
|
$method = "GET";
|
|
|
|
|
$appcode = C('tool_age.appcode');
|
|
|
|
|
// $appcode = "244181f0846541a19e24df409736d3b9";
|
|
|
|
|
$headers = array();
|
|
|
|
|
array_push($headers, "Authorization:APPCODE " . $appcode);
|
|
|
|
|
$querys = "idCard=" . $cardno . "&name=" . $name;
|
|
|
|
@ -1231,15 +1232,22 @@ function age($cardno, $name)
|
|
|
|
|
if (empty($output)) {
|
|
|
|
|
return -1;//用完
|
|
|
|
|
}
|
|
|
|
|
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;//失败
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$r = json_decode($output, true);
|
|
|
|
|
if ($r['status'] == "02") return 0;
|
|
|
|
|
return $r;
|
|
|
|
|
// if (empty($output)) {
|
|
|
|
|
// return -1;//用完
|
|
|
|
|
// }
|
|
|
|
|
// 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;//失败
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*短信发送验证限制条件 */
|
|
|
|
|