!11 修复因PHP7.4+不兼容的嵌套三元操作符语法,导致的用户授权等错误问题

Merge pull request !11 from liuyi/master
This commit is contained in:
Devil 2020-05-13 11:25:11 +08:00 committed by Gitee
commit 6ff016d4b3

View File

@ -139,7 +139,7 @@ class User extends Common
if(empty($user)) if(empty($user))
{ {
$this->data_post['nick_name'] = isset($this->data_post['nickName']) ? $this->data_post['nickName'] : ''; $this->data_post['nick_name'] = isset($this->data_post['nickName']) ? $this->data_post['nickName'] : '';
$this->data_post['gender'] = empty($this->data_post['gender']) ? 0 : ($this->data_post['gender'] == 'f') ? 1 : 2; $this->data_post['gender'] = empty($this->data_post['gender']) ? 0 : (($this->data_post['gender'] == 'f') ? 1 : 2);
return UserService::AuthUserProgram($this->data_post, 'alipay_openid'); return UserService::AuthUserProgram($this->data_post, 'alipay_openid');
} else { } else {
return DataReturn('授权成功', 0, $user); return DataReturn('授权成功', 0, $user);
@ -225,7 +225,7 @@ class User extends Common
{ {
$result['nick_name'] = isset($result['nickName']) ? $result['nickName'] : ''; $result['nick_name'] = isset($result['nickName']) ? $result['nickName'] : '';
$result['avatar'] = isset($result['avatarUrl']) ? $result['avatarUrl'] : ''; $result['avatar'] = isset($result['avatarUrl']) ? $result['avatarUrl'] : '';
$result['gender'] = empty($result['gender']) ? 0 : ($result['gender'] == 2) ? 1 : 2; $result['gender'] = empty($result['gender']) ? 0 : (($result['gender'] == 2) ? 1 : 2);
$result['weixin_unionid'] = isset($result['unionId']) ? $result['unionId'] : ''; $result['weixin_unionid'] = isset($result['unionId']) ? $result['unionId'] : '';
$result['openid'] = $result['openId']; $result['openid'] = $result['openId'];
$result['referrer']= isset($this->data_post['referrer']) ? $this->data_post['referrer'] : 0; $result['referrer']= isset($this->data_post['referrer']) ? $this->data_post['referrer'] : 0;
@ -318,7 +318,7 @@ class User extends Common
{ {
$result['nick_name'] = isset($result['data']['nickname']) ? $result['data']['nickname'] : ''; $result['nick_name'] = isset($result['data']['nickname']) ? $result['data']['nickname'] : '';
$result['avatar'] = isset($result['data']['headimgurl']) ? $result['data']['headimgurl'] : ''; $result['avatar'] = isset($result['data']['headimgurl']) ? $result['data']['headimgurl'] : '';
$result['gender'] = empty($result['data']['sex']) ? 0 : ($result['data']['sex'] == 2) ? 1 : 2; $result['gender'] = empty($result['data']['sex']) ? 0 : (($result['data']['sex'] == 2) ? 1 : 2);
$result['openid'] = $result['data']['openid']; $result['openid'] = $result['data']['openid'];
$result['referrer']= isset($this->data_post['referrer']) ? $this->data_post['referrer'] : 0; $result['referrer']= isset($this->data_post['referrer']) ? $this->data_post['referrer'] : 0;
return UserService::AuthUserProgram($result, 'baidu_openid'); return UserService::AuthUserProgram($result, 'baidu_openid');
@ -400,7 +400,7 @@ class User extends Common
{ {
$result['nick_name'] = isset($result['nickName']) ? $result['nickName'] : ''; $result['nick_name'] = isset($result['nickName']) ? $result['nickName'] : '';
$result['avatar'] = isset($result['avatarUrl']) ? $result['avatarUrl'] : ''; $result['avatar'] = isset($result['avatarUrl']) ? $result['avatarUrl'] : '';
$result['gender'] = empty($result['gender']) ? 0 : ($result['gender'] == 2) ? 1 : 2; $result['gender'] = empty($result['gender']) ? 0 : (($result['gender'] == 2) ? 1 : 2);
$result['openid'] = $this->data_post['openid']; $result['openid'] = $this->data_post['openid'];
$result['referrer']= isset($this->data_post['referrer']) ? $this->data_post['referrer'] : 0; $result['referrer']= isset($this->data_post['referrer']) ? $this->data_post['referrer'] : 0;
return UserService::AuthUserProgram($result, 'toutiao_openid'); return UserService::AuthUserProgram($result, 'toutiao_openid');
@ -488,7 +488,7 @@ class User extends Common
{ {
$result['nick_name'] = isset($result['nickName']) ? $result['nickName'] : ''; $result['nick_name'] = isset($result['nickName']) ? $result['nickName'] : '';
$result['avatar'] = isset($result['avatarUrl']) ? $result['avatarUrl'] : ''; $result['avatar'] = isset($result['avatarUrl']) ? $result['avatarUrl'] : '';
$result['gender'] = empty($result['gender']) ? 0 : ($result['gender'] == 2) ? 1 : 2; $result['gender'] = empty($result['gender']) ? 0 : (($result['gender'] == 2) ? 1 : 2);
$result['qq_unionid'] = isset($result['unionId']) ? $result['unionId'] : ''; $result['qq_unionid'] = isset($result['unionId']) ? $result['unionId'] : '';
$result['openid'] = $result['openId']; $result['openid'] = $result['openId'];
$result['referrer']= isset($this->data_post['referrer']) ? $this->data_post['referrer'] : 0; $result['referrer']= isset($this->data_post['referrer']) ? $this->data_post['referrer'] : 0;