微信小程序新增用户unionid
parent
3b949e2239
commit
c62cc3a341
|
|
@ -143,11 +143,17 @@
|
|||
<dt>支付宝openid</dt>
|
||||
<dd>{{if empty($v['alipay_openid'])}}<span class="cr-ddd">未知</span>{{else /}}{{$v.alipay_openid}}{{/if}}</dd>
|
||||
|
||||
<dt>百度openid</dt>
|
||||
<dd>{{if empty($v['baidu_openid'])}}<span class="cr-ddd">未知</span>{{else /}}{{$v.baidu_openid}}{{/if}}</dd>
|
||||
|
||||
<dt>微信openid</dt>
|
||||
<dd>{{if empty($v['weixin_openid'])}}<span class="cr-ddd">未知</span>{{else /}}{{$v.weixin_openid}}{{/if}}</dd>
|
||||
|
||||
<dt>百度openid</dt>
|
||||
<dd>{{if empty($v['baidu_openid'])}}<span class="cr-ddd">未知</span>{{else /}}{{$v.baidu_openid}}{{/if}}</dd>
|
||||
<dt>微信unionid</dt>
|
||||
<dd>{{if empty($v['weixin_unionid'])}}<span class="cr-ddd">未知</span>{{else /}}{{$v.weixin_unionid}}{{/if}}</dd>
|
||||
|
||||
<dt>微信webopenid</dt>
|
||||
<dd>{{if empty($v['weixin_web_openid'])}}<span class="cr-ddd">未知</span>{{else /}}{{$v.weixin_web_openid}}{{/if}}</dd>
|
||||
|
||||
<dt>性别</dt>
|
||||
<dd>{{if empty($v['gender_text'])}}<span class="cr-ddd">未设置</span>{{else /}}{{$v.gender_text}}{{/if}}</dd>
|
||||
|
|
|
|||
|
|
@ -37,13 +37,21 @@
|
|||
<label>支付宝openid</label>
|
||||
<input type="text" name="alipay_openid" class="am-radius" placeholder="支付宝openid" data-validation-message="请填写支付宝openid" {{if !empty($data)}} value="{{$data.alipay_openid}}"{{/if}} />
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label>百度openid</label>
|
||||
<input type="text" name="baidu_openid" class="am-radius" placeholder="百度openid" data-validation-message="请填写百度openid" {{if !empty($data)}} value="{{$data.baidu_openid}}"{{/if}} />
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label>微信openid</label>
|
||||
<input type="text" name="weixin_openid" class="am-radius" placeholder="微信openid" data-validation-message="请填写微信openid" {{if !empty($data)}} value="{{$data.weixin_openid}}"{{/if}} />
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label>百度openid</label>
|
||||
<input type="text" name="baidu_openid" class="am-radius" placeholder="百度openid" data-validation-message="请填写百度openid" {{if !empty($data)}} value="{{$data.baidu_openid}}"{{/if}} />
|
||||
<label>微信unionid</label>
|
||||
<input type="text" name="weixin_unionid" class="am-radius" placeholder="微信unionid" data-validation-message="请填写微信unionid" {{if !empty($data)}} value="{{$data.weixin_unionid}}"{{/if}} />
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label>微信webopenid</label>
|
||||
<input type="text" name="weixin_web_openid" class="am-radius" placeholder="微信webopenid" data-validation-message="请填写微信webopenid" {{if !empty($data)}} value="{{$data.weixin_web_openid}}"{{/if}} />
|
||||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
|
|
|
|||
|
|
@ -207,6 +207,7 @@ class User extends Common
|
|||
$result['nick_name'] = isset($result['nickName']) ? $result['nickName'] : '';
|
||||
$result['avatar'] = isset($result['avatarUrl']) ? $result['avatarUrl'] : '';
|
||||
$result['gender'] = empty($result['gender']) ? 0 : ($result['gender'] == 2) ? 1 : 2;
|
||||
$result['weixin_unionid'] = isset($result['unionId']) ? $result['unionId'] : '';
|
||||
$result['openid'] = $result['openId'];
|
||||
$result['referrer']= isset($this->data_post['referrer']) ? $this->data_post['referrer'] : 0;
|
||||
return UserService::AuthUserProgram($result, 'weixin_openid');
|
||||
|
|
|
|||
|
|
@ -314,8 +314,10 @@ class UserService
|
|||
'integral' => intval($params['integral']),
|
||||
'status' => intval($params['status']),
|
||||
'alipay_openid' => isset($params['alipay_openid']) ? $params['alipay_openid'] : '',
|
||||
'weixin_openid' => isset($params['weixin_openid']) ? $params['weixin_openid'] : '',
|
||||
'baidu_openid' => isset($params['baidu_openid']) ? $params['baidu_openid'] : '',
|
||||
'weixin_openid' => isset($params['weixin_openid']) ? $params['weixin_openid'] : '',
|
||||
'weixin_unionid' => isset($params['weixin_unionid']) ? $params['weixin_unionid'] : '',
|
||||
'weixin_web_openid' => isset($params['weixin_web_openid']) ? $params['weixin_web_openid'] : '',
|
||||
'birthday' => empty($params['birthday']) ? 0 : strtotime($params['birthday']),
|
||||
'upd_time' => time(),
|
||||
];
|
||||
|
|
@ -1653,6 +1655,12 @@ class UserService
|
|||
'city' => empty($params['city']) ? '' : $params['city'],
|
||||
'referrer' => isset($params['referrer']) ? $params['referrer'] : 0,
|
||||
];
|
||||
|
||||
// 微信用户unionid
|
||||
if(!empty($params['weixin_unionid']))
|
||||
{
|
||||
$data['weixin_unionid'] = $params['weixin_unionid'];
|
||||
}
|
||||
$user = self::AppUserInfoHandle(null, $field, $params['openid']);
|
||||
if(!empty($user))
|
||||
{
|
||||
|
|
@ -1688,7 +1696,7 @@ class UserService
|
|||
public static function AppUserInfoHandle($user_id = null, $where_field = null, $where_value = null, $user = [])
|
||||
{
|
||||
// 获取用户信息
|
||||
$field = 'id,username,nickname,mobile,email,avatar,alipay_openid,weixin_openid,baidu_openid,integral,locking_integral';
|
||||
$field = 'id,username,nickname,mobile,email,avatar,alipay_openid,weixin_openid,weixin_unionid,weixin_web_openid,baidu_openid,integral,locking_integral';
|
||||
if(!empty($user_id))
|
||||
{
|
||||
$user = self::UserInfo('id', $user_id, $field);
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ App({
|
|||
|
||||
// 请求地址
|
||||
request_url: "{{request_url}}",
|
||||
// request_url: 'http://tp5-dev.com/',
|
||||
request_url: 'http://tp5-dev.com/',
|
||||
// request_url: 'https://test.shopxo.net/',
|
||||
|
||||
// 基础信息
|
||||
|
|
|
|||
|
|
@ -150,6 +150,7 @@ Page({
|
|||
e.detail.value['city'] = this.data.user.city;
|
||||
e.detail.value['gender'] = this.data.user.gender;
|
||||
e.detail.value['app_type'] = 'weixin';
|
||||
e.detail.value['weixin_unionid'] = this.data.user.weixin_unionid || '';
|
||||
e.detail.value['referrer'] = (params == null) ? (this.data.user.referrer || 0) : (params.referrer || 0);
|
||||
if(app.fields_check(e.detail.value, validation))
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue