|
|
|
@ -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;
|
|
|
|
|
}
|
|
|
|
@ -1231,15 +1231,23 @@ 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;//失败
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*短信发送验证限制条件 */
|
|
|
|
|