Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
jamesyang1999
ShopXO
提交
c62cc3a3
ShopXO
项目概览
jamesyang1999
/
ShopXO
与 Fork 源项目一致
Fork自
纵之格 / ShopXO
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
ShopXO
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c62cc3a3
编写于
10月 04, 2019
作者:
D
Devil
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
微信小程序新增用户unionid
上级
3b949e22
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
31 addition
and
7 deletion
+31
-7
application/admin/view/default/user/index.html
application/admin/view/default/user/index.html
+8
-2
application/admin/view/default/user/save_info.html
application/admin/view/default/user/save_info.html
+10
-2
application/api/controller/User.php
application/api/controller/User.php
+1
-0
application/service/UserService.php
application/service/UserService.php
+10
-2
public/appmini/old/weixin/app.js
public/appmini/old/weixin/app.js
+1
-1
public/appmini/old/weixin/pages/login/login.js
public/appmini/old/weixin/pages/login/login.js
+1
-0
未找到文件。
application/admin/view/default/user/index.html
浏览文件 @
c62cc3a3
...
...
@@ -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>
...
...
application/admin/view/default/user/save_info.html
浏览文件 @
c62cc3a3
...
...
@@ -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"
>
...
...
application/api/controller/User.php
浏览文件 @
c62cc3a3
...
...
@@ -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'
);
...
...
application/service/UserService.php
浏览文件 @
c62cc3a3
...
...
@@ -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
);
...
...
public/appmini/old/weixin/app.js
浏览文件 @
c62cc3a3
...
...
@@ -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/',
// 基础信息
...
...
public/appmini/old/weixin/pages/login/login.js
浏览文件 @
c62cc3a3
...
...
@@ -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
))
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录