From c08a01d7e8be16d3b419cf0d6e40f77f27b70d0a Mon Sep 17 00:00:00 2001 From: chenzhi Date: Mon, 2 Dec 2019 18:02:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E5=90=8D=E8=AE=A4=E8=AF=815.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Common/Common/function.php | 32 ++++++++++++------- .../Controller/UserController.class.php | 5 ++- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/Application/Common/Common/function.php b/Application/Common/Common/function.php index f2413eb40..747df8d2c 100644 --- a/Application/Common/Common/function.php +++ b/Application/Common/Common/function.php @@ -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;//失败 + // } } /*短信发送验证限制条件 */ diff --git a/Application/Mobile/Controller/UserController.class.php b/Application/Mobile/Controller/UserController.class.php index ad68de9de..b1bc61ffb 100644 --- a/Application/Mobile/Controller/UserController.class.php +++ b/Application/Mobile/Controller/UserController.class.php @@ -1033,13 +1033,12 @@ class UserController extends BaseController } if ($re == 1) { - $resdata['age_status'] = 2;//成年 + $resdata = 2;//成年 } if ($re == 2) { - $resdata['age_status'] = 3;//未成年 + $resdata = 3;//未成年 } } - // if ($re > 0) { $model = D('User')->where($map)->save(array('real_name' => $_REQUEST['real_name'], 'idcard' => $_REQUEST['idcard'], 'age_status' => $resdata)); // }