Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
纵之格
ShopXO
提交
5aa22610
ShopXO
项目概览
纵之格
/
ShopXO
通知
394
Star
16
Fork
11
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
ShopXO
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
5aa22610
编写于
3月 16, 2023
作者:
G
gongfuxiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
用户多端共享优化、图标导航支持纯净模式
上级
afd24699
变更
21
展开全部
隐藏空白更改
内联
并排
Showing
21 changed file
with
806 addition
and
477 deletion
+806
-477
app/admin/form/Appcenternav.php
app/admin/form/Appcenternav.php
+10
-0
app/admin/form/Brand.php
app/admin/form/Brand.php
+0
-1
app/admin/form/Order.php
app/admin/form/Order.php
+0
-1
app/admin/form/User.php
app/admin/form/User.php
+74
-7
app/admin/lang/en.php
app/admin/lang/en.php
+2
-0
app/admin/lang/zh.php
app/admin/lang/zh.php
+2
-0
app/admin/view/default/apphomenav/module/images.html
app/admin/view/default/apphomenav/module/images.html
+3
-3
app/admin/view/default/quicknav/module/images.html
app/admin/view/default/quicknav/module/images.html
+3
-3
app/admin/view/default/user/detail.html
app/admin/view/default/user/detail.html
+56
-1
app/admin/view/default/user/save_info.html
app/admin/view/default/user/save_info.html
+8
-83
app/api/controller/Common.php
app/api/controller/Common.php
+18
-0
app/lang/en.php
app/lang/en.php
+14
-23
app/lang/zh.php
app/lang/zh.php
+14
-23
app/service/ApiService.php
app/service/ApiService.php
+24
-0
app/service/AppMiniUserService.php
app/service/AppMiniUserService.php
+12
-12
app/service/BuyService.php
app/service/BuyService.php
+1
-1
app/service/GoodsCartService.php
app/service/GoodsCartService.php
+2
-2
app/service/GoodsFavorService.php
app/service/GoodsFavorService.php
+1
-1
app/service/ResourcesService.php
app/service/ResourcesService.php
+16
-2
app/service/UserService.php
app/service/UserService.php
+543
-314
config/shopxo.php
config/shopxo.php
+3
-0
未找到文件。
app/admin/form/Appcenternav.php
浏览文件 @
5aa22610
...
...
@@ -117,6 +117,16 @@ class AppCenterNav
'where_type'
=>
'like'
,
],
],
[
'label'
=>
$lang
[
'desc'
],
'view_type'
=>
'field'
,
'view_key'
=>
'desc'
,
'is_sort'
=>
1
,
'search_config'
=>
[
'form_type'
=>
'input'
,
'where_type'
=>
'like'
,
],
],
[
'label'
=>
$lang
[
'is_enable'
],
'view_type'
=>
'status'
,
...
...
app/admin/form/Brand.php
浏览文件 @
5aa22610
...
...
@@ -46,7 +46,6 @@ class Brand
'status_field'
=>
'is_enable'
,
'is_search'
=>
1
,
'is_delete'
=>
1
,
'delete_url'
=>
MyUrl
(
'admin/brand/delete'
),
'delete_key'
=>
'ids'
,
'detail_title'
=>
MyLang
(
'form_table_base_detail_title'
),
'is_middle'
=>
0
,
...
...
app/admin/form/Order.php
浏览文件 @
5aa22610
...
...
@@ -46,7 +46,6 @@ class Order
'base'
=>
[
'key_field'
=>
'id'
,
'is_search'
=>
1
,
'search_url'
=>
MyUrl
(
'admin/order/index'
),
'detail_title'
=>
MyLang
(
'form_table_base_detail_title'
),
'is_middle'
=>
0
,
],
...
...
app/admin/form/User.php
浏览文件 @
5aa22610
...
...
@@ -45,6 +45,7 @@ class User
'is_delete'
=>
1
,
'is_middle'
=>
0
,
'is_data_export_excel'
=>
1
,
'detail_title'
=>
MyLang
(
'form_table_base_detail_title'
),
],
// 表单配置
'form'
=>
[
...
...
@@ -81,13 +82,33 @@ class User
[
'label'
=>
$lang
[
'system_type'
],
'view_type'
=>
'field'
,
'view_key'
=>
'system_type'
,
'is_sort'
=>
1
,
'view_key'
=>
'system_type_text'
,
'text_truncate'
=>
2
,
'is_popover'
=>
1
,
'search_config'
=>
[
'form_type'
=>
'select'
,
'where_type'
=>
'in'
,
'data'
=>
$this
->
SystemTypeList
(),
'is_multiple'
=>
1
,
'form_type'
=>
'select'
,
'form_name'
=>
'id'
,
'where_type_custom'
=>
'in'
,
'where_value_custom'
=>
'WhereValueSystemType'
,
'data'
=>
$this
->
SystemTypeList
(),
'is_multiple'
=>
1
,
],
],
[
'label'
=>
$lang
[
'platform'
],
'view_type'
=>
'field'
,
'view_key'
=>
'platform_text'
,
'text_truncate'
=>
2
,
'is_popover'
=>
1
,
'search_config'
=>
[
'form_type'
=>
'select'
,
'form_name'
=>
'id'
,
'where_type_custom'
=>
'in'
,
'where_value_custom'
=>
'WhereValuePlatform'
,
'data'
=>
MyLang
(
'common_platform_type'
),
'data_key'
=>
'value'
,
'data_name'
=>
'name'
,
'is_multiple'
=>
1
,
],
],
[
...
...
@@ -288,6 +309,52 @@ class User
];
}
/**
* 系统类型条件处理
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-06-08
* @desc description
* @param [string] $value [条件值]
* @param [array] $params [输入参数]
*/
public
function
WhereValueSystemType
(
$value
,
$params
=
[])
{
if
(
!
empty
(
$value
))
{
// 获取用户 id
$ids
=
Db
::
name
(
'UserPlatform'
)
->
where
(
'system_type'
,
'in'
,
$value
)
->
column
(
'user_id'
);
// 避免空条件造成无效的错觉
return
empty
(
$ids
)
?
[
0
]
:
$ids
;
}
return
$value
;
}
/**
* 用户平台条件处理
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-06-08
* @desc description
* @param [string] $value [条件值]
* @param [array] $params [输入参数]
*/
public
function
WhereValuePlatform
(
$value
,
$params
=
[])
{
if
(
!
empty
(
$value
))
{
// 获取用户 id
$ids
=
Db
::
name
(
'UserPlatform'
)
->
where
(
'platform'
,
'in'
,
$value
)
->
column
(
'user_id'
);
// 避免空条件造成无效的错觉
return
empty
(
$ids
)
?
[
0
]
:
$ids
;
}
return
$value
;
}
/**
* 用户信息条件处理
* @author Devil
...
...
@@ -321,7 +388,7 @@ class User
*/
public
function
SystemTypeList
()
{
return
Db
::
name
(
'User'
)
->
group
(
'system_type'
)
->
column
(
'system_type'
,
'system_type'
);
return
Db
::
name
(
'User
Platform
'
)
->
group
(
'system_type'
)
->
column
(
'system_type'
,
'system_type'
);
}
}
?>
\ No newline at end of file
app/admin/lang/en.php
浏览文件 @
5aa22610
...
...
@@ -87,6 +87,7 @@ return [
'id'
=>
'User ID'
,
'number_code'
=>
'Number Code'
,
'system_type'
=>
'System Type'
,
'platform'
=>
'Platform'
,
'avatar'
=>
'Avatar'
,
'username'
=>
'Username'
,
'nickname'
=>
'Nickname'
,
...
...
@@ -914,6 +915,7 @@ return [
'images_url'
=>
'Icon'
,
'event_type'
=>
'Event Tyoe'
,
'event_value'
=>
'Event Value'
,
'desc'
=>
'Desc'
,
'is_enable'
=>
'Enable or not'
,
'is_need_login'
=>
'Whether to log in'
,
'sort'
=>
'Sort'
,
...
...
app/admin/lang/zh.php
浏览文件 @
5aa22610
...
...
@@ -87,6 +87,7 @@ return [
'id'
=>
'用户ID'
,
'number_code'
=>
'会员码'
,
'system_type'
=>
'系统类型'
,
'platform'
=>
'所属平台'
,
'avatar'
=>
'头像'
,
'username'
=>
'用户名'
,
'nickname'
=>
'昵称'
,
...
...
@@ -899,6 +900,7 @@ return [
'images_url'
=>
'导航图标'
,
'event_type'
=>
'事件类型'
,
'event_value'
=>
'事件值'
,
'desc'
=>
'描述'
,
'is_enable'
=>
'是否启用'
,
'is_need_login'
=>
'是否需登录'
,
'sort'
=>
'排序'
,
...
...
app/admin/view/default/apphomenav/module/images.html
浏览文件 @
5aa22610
<!-- 图标 -->
{{if !empty($module_data) and !empty($module_data['images_url'])}}
<div
class=
"am-circle nav-icon-circle"
style=
"background-color:{{if empty($module_data['bg_color'])}}#d0d0d0{{else /}}{{$module_data.bg_color}}{{/if}};"
>
<a
href=
"{{$module_data['images_url']}}"
target=
"_blank"
>
<img
src=
"{{$module_data['images_url']}}"
class=
"am-radius am-vertical-align-middle"
width=
"30"
height=
"30"
/>
<div
class=
"am-circle nav-icon-circle"
{{
if
!
empty
($
module_data
['
bg_color
'])}}
style=
"background-color:{{$module_data.bg_color}};"
{{/
if
}}
>
<a
href=
"{{$module_data['images_url']}}"
target=
"_blank"
class=
"am-block"
>
<img
src=
"{{$module_data['images_url']}}"
class=
"am-radius am-vertical-align-middle"
{{
if
empty
($
module_data
['
bg_color
'])}}
width=
"50"
height=
"50"
{{
else
/}}
width=
"30"
height=
"30"
{{/
if
}}
/>
</a>
</div>
{{/if}}
\ No newline at end of file
app/admin/view/default/quicknav/module/images.html
浏览文件 @
5aa22610
<!-- 图标 -->
{{if !empty($module_data) and !empty($module_data['images_url'])}}
<div
class=
"am-circle nav-icon-circle"
style=
"background-color:{{if empty($module_data['bg_color'])}}#d0d0d0{{else /}}{{$module_data.bg_color}}{{/if}};"
>
<a
href=
"{{$module_data['images_url']}}"
target=
"_blank"
>
<img
src=
"{{$module_data['images_url']}}"
class=
"am-radius am-vertical-align-middle"
width=
"30"
height=
"30"
/>
<div
class=
"am-circle nav-icon-circle"
{{
if
!
empty
($
module_data
['
bg_color
'])}}
style=
"background-color:{{$module_data.bg_color}};"
{{/
if
}}
>
<a
href=
"{{$module_data['images_url']}}"
target=
"_blank"
class=
"am-block"
>
<img
src=
"{{$module_data['images_url']}}"
class=
"am-radius am-vertical-align-middle"
{{
if
empty
($
module_data
['
bg_color
'])}}
width=
"50"
height=
"50"
{{
else
/}}
width=
"30"
height=
"30"
{{/
if
}}
/>
</a>
</div>
{{/if}}
\ No newline at end of file
app/admin/view/default/user/detail.html
浏览文件 @
5aa22610
<!-- 继承公共的 form -->
{{extend name="public/module/detail" /}}
\ No newline at end of file
{{extend name="public/module/detail" /}}
<!-- 重写数据模块 -->
{{block name="detail_data"}}
<!-- 父级内容 -->
{__block__}
<!-- 用户平台信息 -->
<div
class=
"am-panel am-panel-default"
>
<div
class=
"am-panel-hd"
>
{{:MyLang('common_service.user.detail_platform_title')}}
</div>
<div
class=
"am-panel-bd"
>
{{if !empty($data['user_platform_data'])}}
<div
class=
"am-scrollable-horizontal"
>
<table
class=
"am-table am-table-bordered am-table-striped am-text-nowrap am-margin-bottom-0"
>
<head>
<tr>
<th>
{{:MyLang('common_service.user.detail_system_type')}}
</th>
<th>
{{:MyLang('common_service.user.detail_platform')}}
</th>
<th>
{{:MyLang('common_service.user.detail_alipay_openid')}}
</th>
<th>
{{:MyLang('common_service.user.detail_baidu_openid')}}
</th>
<th>
{{:MyLang('common_service.user.detail_toutiao_openid')}}
</th>
<th>
{{:MyLang('common_service.user.detail_toutiao_unionid')}}
</th>
<th>
{{:MyLang('common_service.user.detail_qq_openid')}}
</th>
<th>
{{:MyLang('common_service.user.detail_qq_unionid')}}
</th>
<th>
{{:MyLang('common_service.user.detail_weixin_openid')}}
</th>
<th>
{{:MyLang('common_service.user.detail_weixin_unionid')}}
</th>
<th>
{{:MyLang('common_service.user.detail_weixin_web_openid')}}
</th>
<th>
{{:MyLang('common_service.user.detail_kuaishou_openid')}}
</th>
</tr>
</head>
<tbody>
{{foreach $data.user_platform_data as $v}}
<tr>
<td>
{{$v.system_type}}
</td>
<td>
{{$v.platform_name}}
</td>
<td>
{{$v.alipay_openid}}
</td>
<td>
{{$v.baidu_openid}}
</td>
<td>
{{$v.toutiao_openid}}
</td>
<td>
{{$v.toutiao_unionid}}
</td>
<td>
{{$v.qq_openid}}
</td>
<td>
{{$v.qq_unionid}}
</td>
<td>
{{$v.weixin_openid}}
</td>
<td>
{{$v.weixin_unionid}}
</td>
<td>
{{$v.weixin_web_openid}}
</td>
<td>
{{$v.kuaishou_openid}}
</td>
</tr>
{{/foreach}}
</tbody>
</table>
</div>
{{else /}}
{{include file="public/not_data" /}}
{{/if}}
</div>
</div>
{{/block}}
\ No newline at end of file
app/admin/view/default/user/save_info.html
浏览文件 @
5aa22610
...
...
@@ -10,13 +10,7 @@
<a
href=
"{{:MyUrl('admin/user/index', $params)}}"
class=
"am-fr am-text-sm am-margin-top-sm am-icon-mail-reply"
>
{{:MyLang('retreat_title')}}
</a>
</legend>
<div
class=
"am-cf"
>
<div
class=
"am-u-sm-6 am-padding-horizontal-0"
>
<div
class=
"am-form-group"
>
<label>
{{:MyLang('common_service.user.form_item_system_type')}}
<span
class=
"am-form-group-label-tips"
>
{{:MyLang('common_service.user.form_item_system_type_tips')}}
</span></label>
<input
type=
"text"
name=
"system_type_name"
class=
"am-radius"
placeholder=
"{{:MyLang('common_service.user.form_item_system_type_message')}}"
data-validation-message=
"{{:MyLang('common_service.user.form_item_system_type_message')}}"
value=
"{{if empty($data['system_type'])}}default{{else /}}{{$data.system_type}}{{/if}}"
/>
</div>
</div>
<div
class=
"am-u-sm-6 am-padding-horizontal-0"
>
<div
class=
"am-u-md-6 am-padding-horizontal-0"
>
<div
class=
"am-cf"
>
<div
class=
"am-u-sm-6 am-padding-horizontal-0"
>
<div
class=
"am-form-group"
>
...
...
@@ -32,6 +26,9 @@
</div>
</div>
</div>
<div
class=
"am-u-md-6 am-padding-horizontal-0"
>
{{include file="lib/gender" /}}
</div>
</div>
<div
class=
"am-cf"
>
<div
class=
"am-u-sm-6 am-padding-horizontal-0"
>
...
...
@@ -47,97 +44,27 @@
</div>
</div>
</div>
<div
class=
"am-cf"
>
<div
class=
"am-u-sm-6 am-padding-horizontal-0"
>
<div
class=
"am-form-group"
>
<label>
{{:MyLang('common_service.user.form_item_alipay_openid')}}
</label>
<input
type=
"text"
name=
"alipay_openid"
class=
"am-radius"
placeholder=
"{{:MyLang('common_service.user.form_item_alipay_openid')}}"
data-validation-message=
"{{:MyLang('common_service.user.form_item_alipay_openid_message')}}"
value=
"{{if !empty($data['alipay_openid'])}}{{$data.alipay_openid}}{{/if}}"
/>
</div>
</div>
<div
class=
"am-u-sm-6 am-padding-horizontal-0"
>
<div
class=
"am-form-group"
>
<label>
{{:MyLang('common_service.user.form_item_baidu_openid')}}
</label>
<input
type=
"text"
name=
"baidu_openid"
class=
"am-radius"
placeholder=
"{{:MyLang('common_service.user.form_item_baidu_openid')}}"
data-validation-message=
"{{:MyLang('common_service.user.form_item_baidu_openid_message')}}"
value=
"{{if !empty($data['baidu_openid'])}}{{$data.baidu_openid}}{{/if}}"
/>
</div>
</div>
</div>
<div
class=
"am-cf"
>
<div
class=
"am-u-sm-6 am-padding-horizontal-0"
>
<div
class=
"am-form-group"
>
<label>
{{:MyLang('common_service.user.form_item_toutiao_openid')}}
</label>
<input
type=
"text"
name=
"toutiao_openid"
class=
"am-radius"
placeholder=
"{{:MyLang('common_service.user.form_item_toutiao_openid')}}"
data-validation-message=
"{{:MyLang('common_service.user.form_item_toutiao_openid_message')}}"
value=
"{{if !empty($data['toutiao_openid'])}}{{$data.toutiao_openid}}{{/if}}"
/>
</div>
</div>
<div
class=
"am-u-sm-6 am-padding-horizontal-0"
>
<div
class=
"am-form-group"
>
<label>
{{:MyLang('common_service.user.form_item_toutiao_unionid')}}
</label>
<input
type=
"text"
name=
"toutiao_unionid"
class=
"am-radius"
placeholder=
"{{:MyLang('common_service.user.form_item_toutiao_unionid')}}"
data-validation-message=
"{{:MyLang('common_service.user.form_item_toutiao_unionid_message')}}"
value=
"{{if !empty($data['toutiao_unionid'])}}{{$data.toutiao_unionid}}{{/if}}"
/>
</div>
</div>
</div>
<div
class=
"am-cf"
>
<div
class=
"am-u-sm-6 am-padding-horizontal-0"
>
<div
class=
"am-form-group"
>
<label>
{{:MyLang('common_service.user.form_item_qq_openid')}}
</label>
<input
type=
"text"
name=
"qq_openid"
class=
"am-radius"
placeholder=
"{{:MyLang('common_service.user.form_item_qq_openid')}}"
data-validation-message=
"{{:MyLang('common_service.user.form_item_qq_openid_message')}}"
value=
"{{if !empty($data['qq_openid'])}}{{$data.qq_openid}}{{/if}}"
/>
</div>
</div>
<div
class=
"am-u-sm-6 am-padding-horizontal-0"
>
<div
class=
"am-form-group"
>
<label>
{{:MyLang('common_service.user.form_item_qq_unionid')}}
</label>
<input
type=
"text"
name=
"qq_unionid"
class=
"am-radius"
placeholder=
"{{:MyLang('common_service.user.form_item_qq_unionid')}}"
data-validation-message=
"{{:MyLang('common_service.user.form_item_qq_unionid_message')}}"
value=
"{{if !empty($data['qq_unionid'])}}{{$data.qq_unionid}}{{/if}}"
/>
</div>
</div>
</div>
<div
class=
"am-cf"
>
<div
class=
"am-u-sm-6 am-padding-horizontal-0"
>
<div
class=
"am-form-group"
>
<label>
{{:MyLang('common_service.user.form_item_weixin_openid')}}
</label>
<input
type=
"text"
name=
"weixin_openid"
class=
"am-radius"
placeholder=
"{{:MyLang('common_service.user.form_item_weixin_openid')}}"
data-validation-message=
"{{:MyLang('common_service.user.form_item_weixin_openid_message')}}"
value=
"{{if !empty($data['weixin_openid'])}}{{$data.weixin_openid}}{{/if}}"
/>
</div>
</div>
<div
class=
"am-u-sm-6 am-padding-horizontal-0"
>
<div
class=
"am-form-group"
>
<label>
{{:MyLang('common_service.user.form_item_weixin_unionid')}}
</label>
<input
type=
"text"
name=
"weixin_unionid"
class=
"am-radius"
placeholder=
"{{:MyLang('common_service.user.form_item_weixin_unionid')}}"
data-validation-message=
"{{:MyLang('common_service.user.form_item_weixin_unionid_message')}}"
value=
"{{if !empty($data['weixin_unionid'])}}{{$data.weixin_unionid}}{{/if}}"
/>
</div>
</div>
</div>
<div
class=
"am-cf"
>
<div
class=
"am-u-sm-6 am-padding-horizontal-0"
>
<div
class=
"am-form-group"
>
<label>
{{:MyLang('common_service.user.form_item_web_weixin_openid')}}
</label>
<input
type=
"text"
name=
"weixin_web_openid"
class=
"am-radius"
placeholder=
"{{:MyLang('common_service.user.form_item_web_weixin_openid')}}"
data-validation-message=
"{{:MyLang('common_service.user.form_item_web_weixin_openid_message')}}"
value=
"{{if !empty($data['weixin_web_openid'])}}{{$data.weixin_web_openid}}{{/if}}"
/>
</div>
</div>
<div
class=
"am-u-sm-6 am-padding-horizontal-0"
>
<div
class=
"am-form-group"
>
<label>
{{:MyLang('common_service.user.form_item_kuaishou_openid')}}
</label>
<input
type=
"text"
name=
"kuaishou_openid"
class=
"am-radius"
placeholder=
"{{:MyLang('common_service.user.form_item_kuaishou_openid')}}"
data-validation-message=
"{{:MyLang('common_service.user.form_item_kuaishou_openid_message')}}"
value=
"{{if !empty($data['kuaishou_openid'])}}{{$data.kuaishou_openid}}{{/if}}"
/>
</div>
</div>
</div>
<div
class=
"am-cf"
>
<div
class=
"am-u-sm-3 am-padding-horizontal-0"
>
<div
class=
"am-u-sm-
4 am-u-md-
3 am-padding-horizontal-0"
>
<div
class=
"am-form-group"
>
<label>
{{:MyLang('common_service.user.form_item_province')}}
</label>
<input
type=
"text"
placeholder=
"{{:MyLang('common_service.user.form_item_province')}}"
name=
"province"
data-validation-message=
"{{:MyLang('common_service.user.form_item_province_message')}}"
class=
"am-radius"
value=
"{{if !empty($data['province'])}}{{$data.province}}{{/if}}"
/>
</div>
</div>
<div
class=
"am-u-sm-3 am-padding-horizontal-0"
>
<div
class=
"am-u-sm-
4 am-u-md-
3 am-padding-horizontal-0"
>
<div
class=
"am-form-group"
>
<label>
{{:MyLang('common_service.user.form_item_city')}}
</label>
<input
type=
"text"
placeholder=
"{{:MyLang('common_service.user.form_item_city')}}"
name=
"city"
data-validation-message=
"{{:MyLang('common_service.user.form_item_city_message')}}"
class=
"am-radius"
value=
"{{if !empty($data['city'])}}{{$data.city}}{{/if}}"
/>
</div>
</div>
<div
class=
"am-u-sm-3 am-padding-horizontal-0"
>
<div
class=
"am-u-sm-
4 am-u-md-
3 am-padding-horizontal-0"
>
<div
class=
"am-form-group"
>
<label>
{{:MyLang('common_service.user.form_item_county')}}
</label>
<input
type=
"text"
placeholder=
"{{:MyLang('common_service.user.form_item_county')}}"
name=
"county"
data-validation-message=
"{{:MyLang('common_service.user.form_item_county_message')}}"
class=
"am-radius"
value=
"{{if !empty($data['county'])}}{{$data.county}}{{/if}}"
/>
</div>
</div>
<div
class=
"am-u-sm-3 am-padding-horizontal-0"
>
<div
class=
"am-u-sm-
12 am-u-md-
3 am-padding-horizontal-0"
>
<div
class=
"am-form-group"
>
<label>
{{:MyLang('common_service.user.form_item_address')}}
</label>
<input
type=
"text"
placeholder=
"{{:MyLang('common_service.user.form_item_address')}}"
name=
"address"
data-validation-message=
"{{:MyLang('common_service.user.form_item_address_message')}}"
class=
"am-radius"
value=
"{{if !empty($data['address'])}}{{$data.address}}{{/if}}"
/>
...
...
@@ -187,8 +114,6 @@
</div>
</div>
{{include file="lib/gender" /}}
<!-- 插件扩展数据 start -->
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
<div
class=
"plugins-tag"
>
...
...
app/api/controller/Common.php
浏览文件 @
5aa22610
...
...
@@ -89,6 +89,9 @@ class Common extends BaseController
// 公共数据初始化
$this
->
CommonInit
();
// token验证
$this
->
TokenCheck
();
}
/**
...
...
@@ -214,6 +217,21 @@ class Common extends BaseController
$this
->
page_size
=
10
;
}
/**
* token验证
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2018-04-18T16:20:58+0800
*/
private
function
TokenCheck
()
{
if
(
!
empty
(
$this
->
user
)
&&
!
empty
(
$this
->
data_request
[
'token'
])
&&
$this
->
data_request
[
'token'
]
!=
ApiService
::
CreatedUserToken
(
$this
->
user
[
'id'
]))
{
exit
(
json_encode
(
DataReturn
(
'token非法'
,
-
1000
)));
}
}
/**
* 空方法响应
* @author Devil
...
...
app/lang/en.php
浏览文件 @
5aa22610
...
...
@@ -2170,9 +2170,6 @@ return [
// 用户
'user'
=>
[
// 表单
'form_item_system_type'
=>
'System Type'
,
'form_item_system_type_tips'
=>
'default'
,
'form_item_system_type_message'
=>
'System type 2~60 characters'
,
'form_item_username'
=>
'Username'
,
'form_item_username_message'
=>
'User name 2~30 characters'
,
'form_item_nickname'
=>
'Nickname'
,
...
...
@@ -2181,26 +2178,6 @@ return [
'form_item_mobile_message'
=>
'Mobile number format error'
,
'form_item_email'
=>
'E-mail'
,
'form_item_email_message'
=>
'Email format error'
,
'form_item_alipay_openid'
=>
'Alipay openid'
,
'form_item_alipay_openid_message'
=>
'Please fill in Alipay openid'
,
'form_item_baidu_openid'
=>
'Baidu openid'
,
'form_item_baidu_openid_message'
=>
'Please fill in Baidu openid'
,
'form_item_toutiao_openid'
=>
'Toutiao openid'
,
'form_item_toutiao_openid_message'
=>
'Please fill in the header openid'
,
'form_item_toutiao_unionid'
=>
'Toutiao unionid'
,
'form_item_toutiao_unionid_message'
=>
'Please fill in the headline unionid'
,
'form_item_qq_openid'
=>
'QQopenid'
,
'form_item_qq_openid_message'
=>
'Please fill in QQ openid'
,
'form_item_qq_unionid'
=>
'QQunionid'
,
'form_item_qq_unionid_message'
=>
'Please fill in QQuinonid'
,
'form_item_weixin_openid'
=>
'WeChat openid'
,
'form_item_weixin_openid_message'
=>
'Please fill in WeChat openid'
,
'form_item_weixin_unionid'
=>
'WeChat unionid'
,
'form_item_weixin_unionid_message'
=>
'Please fill in WeChat unionid'
,
'form_item_web_weixin_openid'
=>
'WeChat webopenid'
,
'form_item_web_weixin_openid_message'
=>
'Please fill in WeChat webopenid'
,
'form_item_kuaishou_openid'
=>
'Kwai openid'
,
'form_item_kuaishou_openid_message'
=>
'Please fill in the Kwai openid'
,
'form_item_province'
=>
'Province'
,
'form_item_province_message'
=>
'Maximum 60 characters in the province'
,
'form_item_city'
=>
'City'
,
...
...
@@ -2220,6 +2197,20 @@ return [
'form_item_pwd'
=>
'Login Password'
,
'form_item_pwd_tips'
=>
'Enter to change the password'
,
'form_item_pwd_message'
=>
'Login password format is between 6 and 18 characters'
,
// 详情
'detail_platform_title'
=>
'User Platform Info'
,
'detail_system_type'
=>
'System Type'
,
'detail_platform'
=>
'Platform'
,
'detail_alipay_openid'
=>
'Alipay openid'
,
'detail_baidu_openid'
=>
'Baidu openid'
,
'detail_toutiao_openid'
=>
'Toutiao openid'
,
'detail_toutiao_unionid'
=>
'Toutiao unionid'
,
'detail_qq_openid'
=>
'QQopenid'
,
'detail_qq_unionid'
=>
'QQunionid'
,
'detail_weixin_openid'
=>
'WeChat openid'
,
'detail_weixin_unionid'
=>
'WeChat unionid'
,
'detail_web_weixin_openid'
=>
'WeChat webopenid'
,
'detail_kuaishou_openid'
=>
'Kwai openid'
,
// 保存
'save_admin_info_error_tips'
=>
'The current operation administrator information is incorrect'
,
'save_user_already_exist_tips'
=>
'User already exists[{$var}]'
,
...
...
app/lang/zh.php
浏览文件 @
5aa22610
...
...
@@ -2175,9 +2175,6 @@ return [
// 用户
'user'
=>
[
// 表单
'form_item_system_type'
=>
'系统类型'
,
'form_item_system_type_tips'
=>
'默认 default'
,
'form_item_system_type_message'
=>
'系统类型2~60字符'
,
'form_item_username'
=>
'用户名'
,
'form_item_username_message'
=>
'用户名2~30个字符'
,
'form_item_nickname'
=>
'昵称'
,
...
...
@@ -2186,26 +2183,6 @@ return [
'form_item_mobile_message'
=>
'手机号码格式错误'
,
'form_item_email'
=>
'电子邮箱'
,
'form_item_email_message'
=>
'电子邮箱格式错误'
,
'form_item_alipay_openid'
=>
'支付宝openid'
,
'form_item_alipay_openid_message'
=>
'请填写支付宝openid'
,
'form_item_baidu_openid'
=>
'百度openid'
,
'form_item_baidu_openid_message'
=>
'请填写百度openid'
,
'form_item_toutiao_openid'
=>
'头条openid'
,
'form_item_toutiao_openid_message'
=>
'请填写头条openid'
,
'form_item_toutiao_unionid'
=>
'头条unionid'
,
'form_item_toutiao_unionid_message'
=>
'请填写头条unionid'
,
'form_item_qq_openid'
=>
'QQopenid'
,
'form_item_qq_openid_message'
=>
'请填写QQopenid'
,
'form_item_qq_unionid'
=>
'QQunionid'
,
'form_item_qq_unionid_message'
=>
'请填写QQunionid'
,
'form_item_weixin_openid'
=>
'微信openid'
,
'form_item_weixin_openid_message'
=>
'请填写微信openid'
,
'form_item_weixin_unionid'
=>
'微信unionid'
,
'form_item_weixin_unionid_message'
=>
'请填写微信unionid'
,
'form_item_web_weixin_openid'
=>
'微信webopenid'
,
'form_item_web_weixin_openid_message'
=>
'请填写微信webopenid'
,
'form_item_kuaishou_openid'
=>
'快手openid'
,
'form_item_kuaishou_openid_message'
=>
'请填写快手openid'
,
'form_item_province'
=>
'所在省'
,
'form_item_province_message'
=>
'所在省最多60个字符'
,
'form_item_city'
=>
'所在市'
,
...
...
@@ -2225,6 +2202,20 @@ return [
'form_item_pwd'
=>
'登录密码'
,
'form_item_pwd_tips'
=>
'输入则修改密码'
,
'form_item_pwd_message'
=>
'登录密码格式6~18个字符之间'
,
// 详情
'detail_platform_title'
=>
'用户平台信息'
,
'detail_system_type'
=>
'系统类型'
,
'detail_platform'
=>
'所属平台'
,
'detail_alipay_openid'
=>
'支付宝openid'
,
'detail_baidu_openid'
=>
'百度openid'
,
'detail_toutiao_openid'
=>
'头条openid'
,
'detail_toutiao_unionid'
=>
'头条unionid'
,
'detail_qq_openid'
=>
'QQopenid'
,
'detail_qq_unionid'
=>
'QQunionid'
,
'detail_weixin_openid'
=>
'微信openid'
,
'detail_weixin_unionid'
=>
'微信unionid'
,
'detail_weixin_web_openid'
=>
'微信webopenid'
,
'detail_kuaishou_openid'
=>
'快手openid'
,
// 保存
'save_admin_info_error_tips'
=>
'当前操作管理员信息有误'
,
'save_user_already_exist_tips'
=>
'用户已存在[{$var}]'
,
...
...
app/service/ApiService.php
浏览文件 @
5aa22610
...
...
@@ -42,5 +42,29 @@ class ApiService
return
json
(
$data
);
}
/**
* 用户token生成
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2021-02-26
* @desc description
* @param [int] $user_id [用户id]
*/
public
static
function
CreatedUserToken
(
$user_id
)
{
$arr
=
[
'USER'
,
'HTTP_USER_AGENT'
,
'HTTP_HOST'
,
'SERVER_SOFTWARE'
,
'GATEWAY_INTERFACE'
,
'REQUEST_SCHEME'
,
'SERVER_PROTOCOL'
];
$data
=
[
GetClientIP
(),
APPLICATION_CLIENT_TYPE
];
foreach
(
$arr
as
$v
)
{
if
(
isset
(
$_SERVER
[
$v
]))
{
$data
[]
=
$_SERVER
[
$v
];
}
}
sort
(
$data
);
return
md5
(
md5
(
implode
(
''
,
$data
))
.
md5
(
$user_id
));
}
}
?>
\ No newline at end of file
app/service/AppMiniUserService.php
浏览文件 @
5aa22610
...
...
@@ -73,7 +73,7 @@ class AppMiniUserService
$ret
=
DataReturn
(
MyLang
(
'common_service.appminiuser.auth_login_success_tips'
),
0
,
[
'is_user_exist'
=>
0
,
'openid'
=>
$ret
[
'data'
][
'user_id'
]]);
}
else
{
// 用户状态
$ret
=
UserService
::
UserStatusCheck
(
'id'
,
$user
[
'id'
]);
$ret
=
UserService
::
UserStatusCheck
(
$user
[
'id'
]);
if
(
$ret
[
'code'
]
==
0
)
{
// 标记用户存在
...
...
@@ -131,7 +131,7 @@ class AppMiniUserService
$ret
=
UserService
::
AuthUserProgram
(
$auth_data
,
'alipay_openid'
);
}
else
{
// 用户状态
$ret
=
UserService
::
UserStatusCheck
(
'id'
,
$user
[
'id'
]);
$ret
=
UserService
::
UserStatusCheck
(
$user
[
'id'
]);
if
(
$ret
[
'code'
]
==
0
)
{
$ret
=
DataReturn
(
MyLang
(
'auth_success'
),
0
,
$user
);
...
...
@@ -207,7 +207,7 @@ class AppMiniUserService
// 用户状态
if
(
!
empty
(
$user
))
{
$ret
=
UserService
::
UserStatusCheck
(
'id'
,
$user
[
'id'
]);
$ret
=
UserService
::
UserStatusCheck
(
$user
[
'id'
]);
if
(
$ret
[
'code'
]
==
0
)
{
// 标记用户存在
...
...
@@ -263,7 +263,7 @@ class AppMiniUserService
$ret
=
UserService
::
AuthUserProgram
(
$auth_data
,
'weixin_openid'
);
}
else
{
// 用户状态
$ret
=
UserService
::
UserStatusCheck
(
'id'
,
$user
[
'id'
]);
$ret
=
UserService
::
UserStatusCheck
(
$user
[
'id'
]);
if
(
$ret
[
'code'
]
==
0
)
{
$ret
=
DataReturn
(
MyLang
(
'auth_success'
),
0
,
$user
);
...
...
@@ -299,7 +299,7 @@ class AppMiniUserService
if
(
!
empty
(
$user
))
{
// 用户状态
$ret
=
UserService
::
UserStatusCheck
(
'id'
,
$user
[
'id'
]);
$ret
=
UserService
::
UserStatusCheck
(
$user
[
'id'
]);
if
(
$ret
[
'code'
]
==
0
)
{
// 标记用户存在
...
...
@@ -384,7 +384,7 @@ class AppMiniUserService
}
}
else
{
// 用户状态
$ret
=
UserService
::
UserStatusCheck
(
'id'
,
$user
[
'id'
]);
$ret
=
UserService
::
UserStatusCheck
(
$user
[
'id'
]);
if
(
$ret
[
'code'
]
==
0
)
{
$ret
=
DataReturn
(
MyLang
(
'auth_success'
),
0
,
$user
);
...
...
@@ -454,7 +454,7 @@ class AppMiniUserService
// 用户状态
if
(
!
empty
(
$user
))
{
$ret
=
UserService
::
UserStatusCheck
(
'id'
,
$user
[
'id'
]);
$ret
=
UserService
::
UserStatusCheck
(
$user
[
'id'
]);
if
(
$ret
[
'code'
]
==
0
)
{
// 标记用户存在
...
...
@@ -507,7 +507,7 @@ class AppMiniUserService
$ret
=
UserService
::
AuthUserProgram
(
$auth_data
,
'toutiao_openid'
);
}
else
{
// 用户状态
$ret
=
UserService
::
UserStatusCheck
(
'id'
,
$user
[
'id'
]);
$ret
=
UserService
::
UserStatusCheck
(
$user
[
'id'
]);
if
(
$ret
[
'code'
]
==
0
)
{
$ret
=
DataReturn
(
MyLang
(
'auth_success'
),
0
,
$user
);
...
...
@@ -544,7 +544,7 @@ class AppMiniUserService
$ret
=
DataReturn
(
MyLang
(
'common_service.appminiuser.auth_login_success_tips'
),
0
,
[
'is_user_exist'
=>
0
,
'openid'
=>
$ret
[
'data'
][
'openid'
]]);
}
else
{
// 用户状态
$ret
=
UserService
::
UserStatusCheck
(
'id'
,
$user
[
'id'
]);
$ret
=
UserService
::
UserStatusCheck
(
$user
[
'id'
]);
if
(
$ret
[
'code'
]
==
0
)
{
// 标记用户存在
...
...
@@ -596,7 +596,7 @@ class AppMiniUserService
$ret
=
UserService
::
AuthUserProgram
(
$auth_data
,
'kuaishou_openid'
);
}
else
{
// 用户状态
$ret
=
UserService
::
UserStatusCheck
(
'id'
,
$user
[
'id'
]);
$ret
=
UserService
::
UserStatusCheck
(
$user
[
'id'
]);
if
(
$ret
[
'code'
]
==
0
)
{
$ret
=
DataReturn
(
MyLang
(
'auth_success'
),
0
,
$user
);
...
...
@@ -666,7 +666,7 @@ class AppMiniUserService
// 用户状态
if
(
!
empty
(
$user
))
{
$ret
=
UserService
::
UserStatusCheck
(
'id'
,
$user
[
'id'
]);
$ret
=
UserService
::
UserStatusCheck
(
$user
[
'id'
]);
if
(
$ret
[
'code'
]
==
0
)
{
// 标记用户存在
...
...
@@ -747,7 +747,7 @@ class AppMiniUserService
}
}
else
{
// 用户状态
$ret
=
UserService
::
UserStatusCheck
(
'id'
,
$user
[
'id'
]);
$ret
=
UserService
::
UserStatusCheck
(
$user
[
'id'
]);
if
(
$ret
[
'code'
]
==
0
)
{
$ret
=
DataReturn
(
MyLang
(
'auth_success'
),
0
,
$user
);
...
...
app/service/BuyService.php
浏览文件 @
5aa22610
...
...
@@ -638,7 +638,7 @@ class BuyService
$common_order_is_booking
=
MyC
(
'common_order_is_booking'
,
0
);
// 查询用户状态是否正常
$ret
=
UserService
::
UserStatusCheck
(
'id'
,
$params
[
'user'
][
'id'
]);
$ret
=
UserService
::
UserStatusCheck
(
$params
[
'user'
][
'id'
]);
if
(
$ret
[
'code'
]
!=
0
)
{
return
$ret
;
...
...
app/service/GoodsCartService.php
浏览文件 @
5aa22610
...
...
@@ -243,7 +243,7 @@ class GoodsCartService
}
// 查询用户状态是否正常
$ret
=
UserService
::
UserStatusCheck
(
'id'
,
$params
[
'user'
][
'id'
]);
$ret
=
UserService
::
UserStatusCheck
(
$params
[
'user'
][
'id'
]);
if
(
$ret
[
'code'
]
!=
0
)
{
return
$ret
;
...
...
@@ -391,7 +391,7 @@ class GoodsCartService
}
// 查询用户状态是否正常
$ret
=
UserService
::
UserStatusCheck
(
'id'
,
$params
[
'user'
][
'id'
]);
$ret
=
UserService
::
UserStatusCheck
(
$params
[
'user'
][
'id'
]);
if
(
$ret
[
'code'
]
!=
0
)
{
return
$ret
;
...
...
app/service/GoodsFavorService.php
浏览文件 @
5aa22610
...
...
@@ -56,7 +56,7 @@ class GoodsFavorService
}
// 查询用户状态是否正常
$ret
=
UserService
::
UserStatusCheck
(
'id'
,
$params
[
'user'
][
'id'
]);
$ret
=
UserService
::
UserStatusCheck
(
$params
[
'user'
][
'id'
]);
if
(
$ret
[
'code'
]
!=
0
)
{
return
$ret
;
...
...
app/service/ResourcesService.php
浏览文件 @
5aa22610
...
...
@@ -792,9 +792,23 @@ class ResourcesService
*/
public
static
function
TableStructureData
(
$table
)
{
// 表名处理及sql
$table_name
=
MyConfig
(
'database.connections.mysql.prefix'
)
.
strtolower
(
preg_replace
(
'/\B([A-Z])/'
,
'_$1'
,
$table
));
$res
=
Db
::
query
(
'SELECT COLUMN_NAME AS field,COLUMN_COMMENT AS name FROM INFORMATION_SCHEMA.Columns WHERE `table_name`="'
.
$table_name
.
'"'
);
return
empty
(
$res
)
?
[]
:
array_column
(
$res
,
'name'
,
'field'
);
$sql
=
'SELECT COLUMN_NAME AS field,COLUMN_COMMENT AS name FROM INFORMATION_SCHEMA.Columns WHERE `table_name`="'
.
$table_name
.
'"'
;
// 从缓存获取
$key
=
SystemService
::
CacheKey
(
'shopxo.cache_table_structure_key'
)
.
'_'
.
md5
(
$sql
);
$data
=
MyCache
(
$key
);
if
(
$data
===
null
||
MyEnv
(
'app_debug'
))
{
// 查询表结构
$res
=
Db
::
query
(
$sql
);
$data
=
empty
(
$res
)
?
[]
:
array_column
(
$res
,
'name'
,
'field'
);
// 存储缓存
MyCache
(
$key
,
$data
,
180
);
}
return
$data
;
}
}
?>
\ No newline at end of file
app/service/UserService.php
浏览文件 @
5aa22610
此差异已折叠。
点击以展开。
config/shopxo.php
浏览文件 @
5aa22610
...
...
@@ -115,6 +115,9 @@ return [
// 用户中心左侧菜单
'cache_user_center_left_nav_key'
=>
'cache_user_center_left_nav_key_data'
,
// 表结构缓存
'cache_table_structure_key'
=>
'cache_table_structure_key_data'
,
// 站点域名地址
'domain_url'
=>
$domain_url
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录