diff --git a/Application/Common/Common/function.php b/Application/Common/Common/function.php index 20b2b63ac..c7d4909d2 100644 --- a/Application/Common/Common/function.php +++ b/Application/Common/Common/function.php @@ -1197,8 +1197,8 @@ function age_verify($cardno, $name) } else { return 2; } - } elseif ($date['status'] > 200) { - return -2; + } elseif (isset($date['status']) && $date['status'] != '01') { + return $date['status']; } else { return $date; } @@ -1210,11 +1210,11 @@ function age($cardno, $name) $host = "https://idcardcert.market.alicloudapi.com"; $path = "/idCardCert"; $method = "GET"; - $appcode = C('tool_age.appcode'); - // $appcode = "244181f0846541a19e24df409736d3b9"; + // $appcode = C('tool_age.appcode'); + $appcode = "244181f0846541a19e24df409736d3b9"; $headers = array(); array_push($headers, "Authorization:APPCODE " . $appcode); - $querys = "idCard=" . $cardno . "&name=" . $name; + $querys ="idCard={$cardno}&name={$name}"; $bodys = ""; $url = $host . $path . "?" . $querys; $curl = curl_init(); @@ -1223,7 +1223,7 @@ function age($cardno, $name) curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); curl_setopt($curl, CURLOPT_FAILONERROR, false); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); - curl_setopt($curl, CURLOPT_HEADER, true); + curl_setopt($curl, CURLOPT_HEADER, false); if (1 == strpos("$" . $host, "https://")) { curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); @@ -1236,18 +1236,7 @@ function age($cardno, $name) $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/Home/Controller/PromoteCoinController.class.php b/Application/Home/Controller/PromoteCoinController.class.php index 9a6ba8d00..a9dcc566c 100644 --- a/Application/Home/Controller/PromoteCoinController.class.php +++ b/Application/Home/Controller/PromoteCoinController.class.php @@ -424,7 +424,7 @@ class PromoteCoinController extends BaseController $targetAccount = isset($promotes[$log['target_id']]) ? $promotes[$log['target_id']]['account'] : '未知推广账号'; } if ($log['target_type'] == 2) { - $targetAccount = isset($promotes[$log['target_id']]) ? $promotes[$log['target_id']]['account'] : '未知玩家'; + $targetAccount = isset($users[$log['target_id']]) ? $users[$log['target_id']]['account'] : '未知玩家'; } $records[] = [ 'id' => $log['id'], diff --git a/Application/Home/Controller/QueryController.class.php b/Application/Home/Controller/QueryController.class.php index 7df6a7e21..c3921b8fe 100644 --- a/Application/Home/Controller/QueryController.class.php +++ b/Application/Home/Controller/QueryController.class.php @@ -1850,7 +1850,7 @@ class QueryController extends BaseController $list['server_name'] = empty($list['server_name']) ? '--' : $list['server_name']; $list['role_name'] = empty($list['role_name']) ? '--' : $list['role_name']; $list['role_level'] = empty($list['role_level']) ? '--' : $list['role_level']; - $list['unlogin_day'] = empty($list['unlogin_day']) ? '--' : intval((strtotime(date('Y-m-d 00:00:00')) - strtotime(date('Y-m-d 00:00:00', $list['play_time']))) / (24 * 3600)); + $list['unlogin_day'] = empty($list['play_time']) ? '--' : intval((strtotime(date('Y-m-d 00:00:00')) - strtotime(date('Y-m-d 00:00:00', $list['play_time']))) / (24 * 3600)); $list['play_time'] = empty($list['play_time']) ? '--' : date('Y-m-d H:i:s', $list['play_time']); $list['promote_account'] = empty($list['promote_account']) ? '--' : $list['promote_account']; } diff --git a/Application/Mobile/Controller/UserController.class.php b/Application/Mobile/Controller/UserController.class.php index b1bc61ffb..98dfee58b 100644 --- a/Application/Mobile/Controller/UserController.class.php +++ b/Application/Mobile/Controller/UserController.class.php @@ -1021,27 +1021,43 @@ class UserController extends BaseController if ($status == 0) { $this->ajaxReturn(array('status' => 0, 'info' => '实名认证暂未开启!', 'url' => U('User/userauth'))); } else { - $re = age_verify($_REQUEST['real_name'], $_REQUEST['idcard']); - if ($re == 0) { - $this->ajaxReturn(array('status' => 0, 'info' => '审核失败!', 'url' => U('User/userauth'))); - } - if ($re == -1) { - $this->ajaxReturn(array('status' => 0, 'info' => '短信数量已使用完!', 'url' => U('User/userauth'))); - } - if ($re == -2) { - $this->ajaxReturn(array('status' => 0, 'info' => '连接错误,请检查配置!', 'url' => U('User/userauth'))); - } - - if ($re == 1) { - $resdata = 2;//成年 - } - if ($re == 2) { - $resdata = 3;//未成年 + //PC_REAL_NAME_REGISTER + $ages = M("Config")->where("name = 'PC_REAL_NAME_REGISTER'")->field("status")->find()['status']; + if($ages == 1){ + $re =age_verify($_REQUEST['idcard'],$_REQUEST['real_name']); + if ($re == 0) { + $this->ajaxReturn(array('status' => 0, 'info' => '审核失败!', 'url' => U('User/userauth'))); + } + if ($re == -1) { + $this->ajaxReturn(array('status' => 0, 'info' => '短信数量已使用完!', 'url' => U('User/userauth'))); + } + if ($re == "202") { + $this->ajaxReturn(array('status' => 0, 'info' => '无法验证!【中心中无此身份证记录,军人转业,户口迁移等】', 'url' => U('User/userauth'))); + } + if ($re == "203") { + $this->ajaxReturn(array('status' => 0, 'info' => '异常情况!', 'url' => U('User/userauth'))); + } + if ($re == "204") { + $this->ajaxReturn(array('status' => 0, 'info' => '姓名格式不正确!', 'url' => U('User/userauth'))); + } + if ($re == "205") { + $this->ajaxReturn(array('status' => 0, 'info' => '身份证格式不正确!', 'url' => U('User/userauth'))); + } + if ($re == 1) { + $resdata = 2;//成年 + } + if ($re == 2) { + $resdata = 3;//未成年 + } + }else{ + $re = 2; + $resdata = 2; } + + } + if ($re > 0) { + $model = D('User')->where($map)->save(array('real_name' => $_REQUEST['real_name'], 'idcard' => $_REQUEST['idcard'], 'age_status' => $resdata)); } - // if ($re > 0) { - $model = D('User')->where($map)->save(array('real_name' => $_REQUEST['real_name'], 'idcard' => $_REQUEST['idcard'], 'age_status' => $resdata)); - // } if ($model !== false) {