Commit 7f69232b by 冷斌

fix bug

parent 4218c10e
......@@ -93,6 +93,29 @@ class AuthController extends HomebaseController {
$this->display();
}
protected function auth3($params)
{
$url = 'https://api.253.com/open/carriers/carriers-auth';
$params = [
'appId' => 'pPGkFovq', // appId,登录万数平台查看
'appKey' => 'YLur3BYi', // appKey,登录万数平台查看
'name' => $params['real_name'], // 姓名
'idNum' => $params['cer_no'], // 身份证号
'mobile' => $params['mobile'], // 手机号
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
$result = curl_exec($ch);
return json_decode($result, true);
}
/* 认证保存 */
public function authsave(){
......@@ -104,7 +127,6 @@ class AuthController extends HomebaseController {
exit;
}
$data['uid']=I("uid");
$data['real_name']=I("real_name");
$data['mobile']=I("mobile");
......@@ -114,6 +136,13 @@ class AuthController extends HomebaseController {
$data['handset_view']=I("handset_view");
$data['status']=0;
$data['addtime']=time();
$check = $this->auth3($data);
if (!$check['chargeStatus']) {
echo json_encode(array("ret"=>0,'data'=>array(),'msg'=>'认证失败'));
exit;
}
$authid=M("users_auth")->where("uid='{$data['uid']}'")->getField("uid");
if($authid){
$result=M("users_auth")->where("uid='{$authid}'")->save($data);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment