Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
jamesyang1999
ShopXO
提交
72557441
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,发现更多精彩内容 >>
提交
72557441
编写于
9月 24, 2020
作者:
D
devil
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
后台菜单新增自定义url地址、统计新增当月/上月
上级
5c663cb8
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
286 addition
and
76 deletion
+286
-76
application/admin/controller/Common.php
application/admin/controller/Common.php
+1
-7
application/admin/controller/Power.php
application/admin/controller/Power.php
+1
-1
application/admin/form/Payrequestlog.php
application/admin/form/Payrequestlog.php
+1
-0
application/admin/view/default/index/init.html
application/admin/view/default/index/init.html
+40
-8
application/admin/view/default/power/index.html
application/admin/view/default/power/index.html
+20
-4
application/admin/view/default/public/menu.html
application/admin/view/default/public/menu.html
+2
-2
application/common.php
application/common.php
+1
-1
application/service/AdminPowerService.php
application/service/AdminPowerService.php
+115
-35
application/service/StatisticalService.php
application/service/StatisticalService.php
+98
-10
changelog.txt
changelog.txt
+3
-1
public/static/admin/default/css/index.init.css
public/static/admin/default/css/index.init.css
+2
-5
sourcecode/baidu/pages/login/login.css
sourcecode/baidu/pages/login/login.css
+1
-1
sourcecode/weixin/pages/login/login.wxss
sourcecode/weixin/pages/login/login.wxss
+1
-1
未找到文件。
application/admin/controller/Common.php
浏览文件 @
72557441
...
...
@@ -29,9 +29,6 @@ class Common extends Controller
// 管理员
protected
$admin
;
// 权限
protected
$power
;
// 左边权限菜单
protected
$left_menu
;
...
...
@@ -80,10 +77,7 @@ class Common extends Controller
// 权限菜单
AdminPowerService
::
PowerMenuInit
();
// 权限
$this
->
left_menu
=
isset
(
$this
->
admin
[
'id'
])
?
cache
(
config
(
'cache_admin_left_menu_key'
)
.
$this
->
admin
[
'id'
])
:
[];
$this
->
power
=
isset
(
$this
->
admin
[
'id'
])
?
cache
(
config
(
'cache_admin_power_key'
)
.
$this
->
admin
[
'id'
])
:
[];
$this
->
left_menu
=
AdminPowerService
::
MenuData
();
// 视图初始化
$this
->
ViewInit
();
...
...
application/admin/controller/Power.php
浏览文件 @
72557441
...
...
@@ -50,7 +50,7 @@ class Power extends Common
public
function
Index
()
{
$data_params
=
[
'field'
=>
'id,pid,name,control,action,sort,is_show,icon'
,
'field'
=>
'id,pid,name,control,action,
url,
sort,is_show,icon'
,
'order_by'
=>
'sort asc'
,
'where'
=>
[
'pid'
=>
0
],
];
...
...
application/admin/form/Payrequestlog.php
浏览文件 @
72557441
...
...
@@ -101,6 +101,7 @@ class PayRequestLog
'label'
=>
'请求url地址'
,
'view_type'
=>
'field'
,
'view_key'
=>
'request_url'
,
'grid_size'
=>
'sm'
,
'search_config'
=>
[
'form_type'
=>
'input'
,
'form_name'
=>
'business_handle'
,
...
...
application/admin/view/default/index/init.html
浏览文件 @
72557441
...
...
@@ -14,11 +14,19 @@
<div
class=
"li-content"
>
<p
class=
"name"
>
用户总量
</p>
<p
class=
"total animation-count-to"
data-to=
"{{$user.total_count}}"
data-speed=
"1500"
>
0
</p>
<div
class=
"yesterday"
>
<div
class=
"item am-margin-bottom-xs"
>
<span>
上月
</span>
<span
class=
"animation-count-to"
data-to=
"{{$user.last_month_count}}"
data-speed=
"1500"
>
0
</span>
</div>
<div
class=
"item am-margin-bottom-xs"
>
<span>
当月
</span>
<span
class=
"animation-count-to"
data-to=
"{{$user.same_month_count}}"
data-speed=
"1500"
>
0
</span>
</div>
<div
class=
"item am-margin-bottom-xs"
>
<span>
昨日
</span>
<span
class=
"animation-count-to"
data-to=
"{{$user.yesterday_count}}"
data-speed=
"1500"
>
0
</span>
</div>
<div
class=
"
today
"
>
<div
class=
"
item
"
>
<span>
今日
</span>
<span
class=
"animation-count-to"
data-to=
"{{$user.today_count}}"
data-speed=
"1500"
>
0
</span>
</div>
...
...
@@ -29,11 +37,19 @@
<div
class=
"li-content"
>
<p
class=
"name"
>
订单总量
</p>
<p
class=
"total animation-count-to"
data-to=
"{{$order_number.total_count}}"
data-speed=
"1500"
>
0
</p>
<div
class=
"yesterday"
>
<div
class=
"item am-margin-bottom-xs"
>
<span>
上月
</span>
<span
class=
"animation-count-to"
data-to=
"{{$order_number.last_month_count}}"
data-speed=
"1500"
>
0
</span>
</div>
<div
class=
"item am-margin-bottom-xs"
>
<span>
当月
</span>
<span
class=
"animation-count-to"
data-to=
"{{$order_number.same_month_count}}"
data-speed=
"1500"
>
0
</span>
</div>
<div
class=
"item am-margin-bottom-xs"
>
<span>
昨日
</span>
<span
class=
"animation-count-to"
data-to=
"{{$order_number.yesterday_count}}"
data-speed=
"1500"
>
0
</span>
</div>
<div
class=
"
today
"
>
<div
class=
"
item
"
>
<span>
今日
</span>
<span
class=
"animation-count-to"
data-to=
"{{$order_number.today_count}}"
data-speed=
"1500"
>
0
</span>
</div>
...
...
@@ -44,11 +60,19 @@
<div
class=
"li-content"
>
<p
class=
"name"
>
成交总量
</p>
<p
class=
"total animation-count-to"
data-to=
"{{$order_complete_number.total_count}}"
data-speed=
"1500"
>
0
</p>
<div
class=
"yesterday"
>
<div
class=
"item am-margin-bottom-xs"
>
<span>
上月
</span>
<span
class=
"animation-count-to"
data-to=
"{{$order_complete_number.last_month_count}}"
data-speed=
"1500"
>
0
</span>
</div>
<div
class=
"item am-margin-bottom-xs"
>
<span>
当月
</span>
<span
class=
"animation-count-to"
data-to=
"{{$order_complete_number.same_month_count}}"
data-speed=
"1500"
>
0
</span>
</div>
<div
class=
"item am-margin-bottom-xs"
>
<span>
昨日
</span>
<span
class=
"animation-count-to"
data-to=
"{{$order_complete_number.yesterday_count}}"
data-speed=
"1500"
>
0
</span>
</div>
<div
class=
"
today
"
>
<div
class=
"
item
"
>
<span>
今日
</span>
<span
class=
"animation-count-to"
data-to=
"{{$order_complete_number.today_count}}"
data-speed=
"1500"
>
0
</span>
</div>
...
...
@@ -59,11 +83,19 @@
<div
class=
"li-content"
>
<p
class=
"name"
>
收入总计
</p>
<p
class=
"total animation-count-to"
data-to=
"{{$order_complete_money.total_count}}"
data-speed=
"1500"
data-decimals=
"2"
>
0.00
</p>
<div
class=
"yesterday"
>
<div
class=
"item am-margin-bottom-xs"
>
<span>
上月
</span>
<span
class=
"animation-count-to"
data-to=
"{{$order_complete_money.last_month_count}}"
data-speed=
"1500"
>
0
</span>
</div>
<div
class=
"item am-margin-bottom-xs"
>
<span>
当月
</span>
<span
class=
"animation-count-to"
data-to=
"{{$order_complete_money.same_month_count}}"
data-speed=
"1500"
>
0
</span>
</div>
<div
class=
"item am-margin-bottom-xs"
>
<span>
昨日
</span>
<span
class=
"animation-count-to"
data-to=
"{{$order_complete_money.yesterday_count}}"
data-speed=
"1500"
data-decimals=
"2"
>
0.00
</span>
</div>
<div
class=
"
today
"
>
<div
class=
"
item
"
>
<span>
今日
</span>
<span
class=
"animation-count-to"
data-to=
"{{$order_complete_money.today_count}}"
data-speed=
"1500"
data-decimals=
"2"
>
0.00
</span>
</div>
...
...
application/admin/view/default/power/index.html
浏览文件 @
72557441
...
...
@@ -27,7 +27,13 @@
</div>
<div
class=
"am-popup-bd"
>
<!-- form start -->
<form
class=
"am-form form-validation admin-save"
action=
"{{:MyUrl('admin/power/save')}}"
method=
"POST"
request-type=
"ajax-reload"
request-value=
""
>
<form
class=
"am-form form-validation admin-save"
action=
"{{:MyUrl('admin/power/save')}}"
method=
"POST"
request-type=
"ajax-reload"
>
<div
class=
"am-alert am-alert-warning"
data-am-alert
>
<button
type=
"button"
class=
"am-close"
>
×
</button>
<p>
1. 填写[ 控制器名称 和 方法名称 ]需要对应创建相应的控制器和方法的定义
</p>
<p>
2. 控制器文件位置[ application/admin/controller ]、该操作仅开发人员使用
</p>
<p>
3. 控制器名称/方法名称 与 自定义url地址、两者必须填写一个
</p>
</div>
<div
class=
"am-form-group"
>
<label>
栏目级别
</label>
<select
class=
"am-radius chosen-select"
name=
"pid"
data-validation-message=
"栏目级别选择错误"
>
...
...
@@ -43,15 +49,25 @@
</div>
<div
class=
"am-form-group"
>
<label>
控制器名称
</label>
<input
type=
"text"
placeholder=
"控制器名称"
name=
"control"
pattern=
"{{:lang('common_regex_control')}}"
data-validation-message=
"控制器名格式 1~30 个字符之间(必须以字母开始,可以是字母数字下划线)"
class=
"am-radius"
required
/>
<input
type=
"text"
placeholder=
"控制器名称"
name=
"control"
pattern=
"{{:lang('common_regex_control')}}"
data-validation-message=
"控制器名格式 1~30 个字符之间(必须以字母开始,可以是字母数字下划线)"
class=
"am-radius"
/>
</div>
<div
class=
"am-form-group"
>
<label>
方法名称
</label>
<input
type=
"text"
placeholder=
"方法名称"
name=
"action"
pattern=
"{{:lang('common_regex_action')}}"
data-validation-message=
"方法名格式 1~30 个字符之间(必须以字母开始,可以是字母数字下划线)"
class=
"am-radius"
required
/>
<input
type=
"text"
placeholder=
"方法名称"
name=
"action"
pattern=
"{{:lang('common_regex_action')}}"
data-validation-message=
"方法名格式 1~30 个字符之间(必须以字母开始,可以是字母数字下划线)"
class=
"am-radius"
/>
</div>
<div
class=
"am-form-group"
>
<label>
图标class
<span
class=
"am-form-group-label-tips"
>
参考 http://www.iconfont.cn/ 将icon放到 [ /static/admin/default/css/iconfontmenu.css ] 文件中
</span></label>
<label>
自定义url地址
<span
class=
"am-form-group-label-tips"
>
带http://或https://
</span></label>
<input
type=
"url"
name=
"url"
placeholder=
"自定义url地址"
data-validation-message=
"自定义url地址格式有误"
class=
"am-radius"
/>
</div>
<div
class=
"am-form-group"
>
<label>
图标class
</label>
<input
type=
"text"
placeholder=
"图标class"
name=
"icon"
maxlength=
"60"
data-validation-message=
"图标格式 0~30 个字符之间"
class=
"am-radius"
/>
<div
class=
"am-alert am-alert-warning"
data-am-alert
>
<button
type=
"button"
class=
"am-close"
>
×
</button>
<p>
1. 参考 http://www.iconfont.cn/ 将icon放到 [ /static/admin/default/css/iconfontmenu.css ] 文件中
</p>
<p>
2. 也可以直接使用框架自带的icon、参考 [ http://amazeui.shopxo.net/css/icon/ ]
</p>
<p>
3. 也可以自己使用插件钩子引入自定义的icon图标的css文件,然后使用定义好的icon
</p>
</div>
</div>
<div
class=
"am-form-group"
>
<label>
顺序
</label>
...
...
application/admin/view/default/public/menu.html
浏览文件 @
72557441
...
...
@@ -10,7 +10,7 @@
{{foreach $left_menu as $v}}
{{if empty($v['items'])}}
<li>
<a
href=
"javascript:;"
data-type=
"menu"
data-url=
"{{
:MyUrl('admin/'.strtolower($v['control']).'/'.strtolower($v['action']))
}}"
>
<a
href=
"javascript:;"
data-type=
"menu"
data-url=
"{{
$v.url
}}"
>
{{if !empty($v['icon'])}}
<span
class=
"iconfont {{$v.icon}}"
></span>
{{/if}}
<span
class=
"nav-name"
>
{{$v.name}}
</span>
</a>
...
...
@@ -25,7 +25,7 @@
<ul
class=
"am-list am-collapse admin-sidebar-sub"
id=
"power-menu-{{$v.id}}"
>
{{foreach $v.items as $vs}}
<li>
<a
href=
"javascript:;"
class=
"menu-items-{{$vs.id}}"
data-parent-id=
"{{$v.id}}"
data-type=
"menu"
data-url=
"{{
:MyUrl('admin/'.strtolower($vs['control']).'/'.strtolower($vs['action']))
}}"
>
<a
href=
"javascript:;"
class=
"menu-items-{{$vs.id}}"
data-parent-id=
"{{$v.id}}"
data-type=
"menu"
data-url=
"{{
$vs.url
}}"
>
{{if !empty($vs['icon'])}}
<span
class=
"{{$vs.icon}}"
></span>
{{/if}}
<span
class=
"nav-name"
>
{{$vs.name}}
</span>
</a>
...
...
application/common.php
浏览文件 @
72557441
...
...
@@ -162,7 +162,7 @@ function AdminIsPower($controller = null, $action = null, $unwanted_power = [])
// 权限
// 角色组权限列表校验
$power
=
isset
(
$admin
[
'id'
])
?
cache
(
config
(
'cache_admin_power_key'
)
.
$admin
[
'id'
])
:
[]
;
$power
=
\
app\service\AdminPowerService
::
PowerData
()
;
if
(
!
empty
(
$power
)
&&
is_array
(
$power
)
&&
in_array
(
$controller
.
'_'
.
$action
,
$power
))
{
return
true
;
...
...
application/service/AdminPowerService.php
浏览文件 @
72557441
...
...
@@ -11,6 +11,7 @@
namespace
app\service
;
use
think\Db
;
use
think\facade\Hook
;
/**
* 权限菜单服务层
...
...
@@ -70,28 +71,6 @@ class AdminPowerService
'checked_data'
=>
'2,16'
,
'error_msg'
=>
'权限名称格式 2~16 个字符之间'
,
],
[
'checked_type'
=>
'empty'
,
'key_name'
=>
'control'
,
'error_msg'
=>
'控制器名称不能为空'
,
],
[
'checked_type'
=>
'length'
,
'key_name'
=>
'control'
,
'checked_data'
=>
'1,30'
,
'error_msg'
=>
'控制器名称格式 1~30 个字符之间'
,
],
[
'checked_type'
=>
'empty'
,
'key_name'
=>
'action'
,
'error_msg'
=>
'方法名称不能为空'
,
],
[
'checked_type'
=>
'length'
,
'key_name'
=>
'action'
,
'checked_data'
=>
'1,30'
,
'error_msg'
=>
'方法名称格式 1~30 个字符之间'
,
],
[
'checked_type'
=>
'length'
,
'key_name'
=>
'icon'
,
...
...
@@ -106,6 +85,29 @@ class AdminPowerService
'error_msg'
=>
'是否显示范围值有误'
,
],
];
// 是否自定义url地址
if
(
empty
(
$params
[
'url'
]))
{
$p
[]
=
[
'checked_type'
=>
'length'
,
'key_name'
=>
'control'
,
'checked_data'
=>
'1,30'
,
'error_msg'
=>
'控制器名称格式 1~30 个字符之间'
,
];
$p
[]
=
[
'checked_type'
=>
'length'
,
'key_name'
=>
'action'
,
'checked_data'
=>
'1,30'
,
'error_msg'
=>
'方法名称格式 1~30 个字符之间'
,
];
}
else
{
$p
[]
=
[
'checked_type'
=>
'length'
,
'key_name'
=>
'url'
,
'checked_data'
=>
'1,255'
,
'error_msg'
=>
'自定义url地址格式 1~255 个字符之间'
,
];
}
$ret
=
ParamsChecked
(
$params
,
$p
);
if
(
$ret
!==
true
)
{
...
...
@@ -120,6 +122,7 @@ class AdminPowerService
'name'
=>
$params
[
'name'
],
'control'
=>
$params
[
'control'
],
'action'
=>
$params
[
'action'
],
'url'
=>
$params
[
'url'
],
'is_show'
=>
isset
(
$params
[
'is_show'
])
?
intval
(
$params
[
'is_show'
])
:
0
,
];
if
(
empty
(
$params
[
'id'
]))
...
...
@@ -211,45 +214,65 @@ class AdminPowerService
$admin_power
=
cache
(
config
(
'cache_admin_power_key'
)
.
$admin_id
);
// 缓存没数据则从数据库重新读取
if
((
$role_id
>
0
||
$admin_id
==
1
)
&&
empty
(
$admin_left_menu
))
if
((
(
$role_id
>
0
||
$admin_id
==
1
)
&&
empty
(
$admin_left_menu
))
||
config
(
'app_debug'
))
{
// 获取一级数据
if
(
$admin_id
==
1
||
$role_id
==
1
)
{
$field
=
'id,name,control,action,is_show,icon'
;
$field
=
'id,name,control,action,
url,
is_show,icon'
;
$admin_left_menu
=
Db
::
name
(
'Power'
)
->
where
(
array
(
'pid'
=>
0
))
->
field
(
$field
)
->
order
(
'sort'
)
->
select
();
}
else
{
$field
=
'p.id,p.name,p.control,p.action,p.is_show,p.icon'
;
$field
=
'p.id,p.name,p.control,p.action,p.
url,p.
is_show,p.icon'
;
$admin_left_menu
=
Db
::
name
(
'Power'
)
->
alias
(
'p'
)
->
join
([
'__ROLE_POWER__'
=>
'rp'
],
'p.id=rp.power_id'
)
->
where
(
array
(
'rp.role_id'
=>
$role_id
,
'p.pid'
=>
0
))
->
field
(
$field
)
->
order
(
'p.sort'
)
->
select
();
}
// 有数据,则处理子级数据
if
(
!
empty
(
$admin_left_menu
))
{
foreach
(
$admin_left_menu
as
$k
=>
$v
)
{
// 权限
$admin_power
[
$v
[
'id'
]]
=
strtolower
(
$v
[
'control'
]
.
'_'
.
$v
[
'action'
]);
// 是否存在控制器和方法
if
(
!
empty
(
$v
[
'control'
])
&&
!
empty
(
$v
[
'action'
]))
{
// 权限
$admin_power
[
$v
[
'id'
]]
=
strtolower
(
$v
[
'control'
]
.
'_'
.
$v
[
'action'
]);
// url、存在自定义url则不覆盖
if
(
empty
(
$v
[
'url'
]))
{
$admin_left_menu
[
$k
][
'url'
]
=
MyUrl
(
'admin/'
.
strtolower
(
$v
[
'control'
])
.
'/'
.
strtolower
(
$v
[
'action'
]));
}
}
// 获取子权限
if
(
$admin_id
==
1
||
$role_id
==
1
)
if
(
(
$admin_id
==
1
||
$role_id
==
1
)
&&
!
empty
(
$v
[
'id'
])
)
{
$items
=
Db
::
name
(
'Power'
)
->
where
(
array
(
'pid'
=>
$v
[
'id'
])
)
->
field
(
$field
)
->
order
(
'sort'
)
->
select
();
$items
=
Db
::
name
(
'Power'
)
->
where
(
[
'pid'
=>
intval
(
$v
[
'id'
])]
)
->
field
(
$field
)
->
order
(
'sort'
)
->
select
();
}
else
{
$items
=
Db
::
name
(
'Power'
)
->
alias
(
'p'
)
->
join
([
'__ROLE_POWER__'
=>
'rp'
],
'p.id=rp.power_id'
)
->
where
(
array
(
'rp.role_id'
=>
$role_id
,
'p.pid'
=>
$v
[
'id'
])
)
->
field
(
$field
)
->
order
(
'p.sort'
)
->
select
();
$items
=
Db
::
name
(
'Power'
)
->
alias
(
'p'
)
->
join
([
'__ROLE_POWER__'
=>
'rp'
],
'p.id=rp.power_id'
)
->
where
(
[
'rp.role_id'
=>
$role_id
,
'p.pid'
=>
intval
(
$v
[
'id'
])]
)
->
field
(
$field
)
->
order
(
'p.sort'
)
->
select
();
}
// 权限列表
$is_show_parent
=
$v
[
'is_show'
]
;
$is_show_parent
=
isset
(
$v
[
'is_show'
])
?
$v
[
'is_show'
]
:
0
;
if
(
!
empty
(
$items
))
{
foreach
(
$items
as
$ks
=>
$vs
)
{
// 权限
$admin_power
[
$vs
[
'id'
]]
=
strtolower
(
$vs
[
'control'
]
.
'_'
.
$vs
[
'action'
]);
// 是否存在控制器和方法
if
(
!
empty
(
$vs
[
'control'
])
&&
!
empty
(
$vs
[
'action'
]))
{
// 权限
$admin_power
[
$vs
[
'id'
]]
=
strtolower
(
$vs
[
'control'
]
.
'_'
.
$vs
[
'action'
]);
// url、存在自定义url则不覆盖
if
(
empty
(
$vs
[
'url'
]))
{
$items
[
$ks
][
'url'
]
=
MyUrl
(
'admin/'
.
strtolower
(
$vs
[
'control'
])
.
'/'
.
strtolower
(
$vs
[
'action'
]));
}
}
// 是否显示视图
if
(
$vs
[
'is_show'
]
==
0
)
if
(
isset
(
$vs
[
'is_show'
])
&&
$vs
[
'is_show'
]
==
0
)
{
unset
(
$items
[
$ks
]);
}
...
...
@@ -275,6 +298,63 @@ class AdminPowerService
cache
(
config
(
'cache_admin_left_menu_key'
)
.
$admin_id
,
$admin_left_menu
);
cache
(
config
(
'cache_admin_power_key'
)
.
$admin_id
,
$admin_power
);
}
return
true
;
}
/**
* 获取菜单数据
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-09-24
* @desc description
*/
public
static
function
MenuData
()
{
$admin
=
session
(
'admin'
);
if
(
!
empty
(
$admin
[
'id'
]))
{
$data
=
cache
(
config
(
'cache_admin_left_menu_key'
)
.
$admin
[
'id'
]);
}
// 后台左侧菜单钩子
$hook_name
=
'plugins_service_admin_menu_data'
;
Hook
::
listen
(
$hook_name
,
[
'hook_name'
=>
$hook_name
,
'is_backend'
=>
true
,
'admin'
=>
$admin
,
'data'
=>
&
$data
,
]);
return
empty
(
$data
)
?
[]
:
$data
;
}
/**
* 获取权限数据
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-09-24
* @desc description
*/
public
static
function
PowerData
()
{
$admin
=
session
(
'admin'
);
if
(
!
empty
(
$admin
[
'id'
]))
{
$data
=
cache
(
config
(
'cache_admin_power_key'
)
.
$admin
[
'id'
]);
}
// 后台左侧菜单权限钩子
$hook_name
=
'plugins_service_admin_menu_power_data'
;
Hook
::
listen
(
$hook_name
,
[
'hook_name'
=>
$hook_name
,
'is_backend'
=>
true
,
'admin'
=>
$admin
,
'data'
=>
&
$data
,
]);
return
empty
(
$data
)
?
[]
:
$data
;
}
}
?>
\ No newline at end of file
application/service/StatisticalService.php
浏览文件 @
72557441
...
...
@@ -27,23 +27,31 @@ class StatisticalService
private
static
$nearly_fifteen_days
;
private
static
$nearly_thirty_days
;
// 近30天
日期
// 近30天
private
static
$thirty_time_start
;
private
static
$thirty_time_end
;
// 近15天
日期
// 近15天
private
static
$fifteen_time_start
;
private
static
$fifteen_time_end
;
// 近7天
日期
// 近7天
private
static
$seven_time_start
;
private
static
$seven_time_end
;
// 昨天日期
// 上月
private
static
$last_month_time_start
;
private
static
$last_month_time_end
;
// 当月
private
static
$same_month_time_start
;
private
static
$same_month_time_end
;
// 昨天
private
static
$yesterday_time_start
;
private
static
$yesterday_time_end
;
// 今天
日期
// 今天
private
static
$today_time_start
;
private
static
$today_time_end
;
...
...
@@ -76,6 +84,14 @@ class StatisticalService
self
::
$seven_time_start
=
strtotime
(
date
(
'Y-m-d 00:00:00'
,
strtotime
(
'-7 day'
)));
self
::
$seven_time_end
=
time
();
// 上月
self
::
$last_month_time_start
=
strtotime
(
date
(
'Y-m-01 00:00:00'
,
strtotime
(
'-1 month'
)));
self
::
$last_month_time_end
=
strtotime
(
date
(
'Y-m-t 23:59:59'
,
strtotime
(
'-1 month'
)));
// 当月
self
::
$same_month_time_start
=
strtotime
(
date
(
'Y-m-01 00:00:00'
));
self
::
$same_month_time_end
=
time
();
// 昨天日期
self
::
$yesterday_time_start
=
strtotime
(
date
(
'Y-m-d 00:00:00'
,
strtotime
(
'-1 day'
)));
self
::
$yesterday_time_end
=
strtotime
(
date
(
'Y-m-d 23:59:59'
,
strtotime
(
'-1 day'
)));
...
...
@@ -109,7 +125,7 @@ class StatisticalService
}
/**
* 用户总数,今日,昨日,总数
* 用户总数,今日,昨日,
当月,上月
总数
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
...
...
@@ -124,6 +140,22 @@ class StatisticalService
// 总数
$total_count
=
Db
::
name
(
'User'
)
->
count
();
// 上月
$where
=
[
[
'status'
,
'<='
,
4
],
[
'add_time'
,
'>='
,
self
::
$last_month_time_start
],
[
'add_time'
,
'<='
,
self
::
$last_month_time_end
],
];
$last_month_count
=
Db
::
name
(
'User'
)
->
where
(
$where
)
->
count
();
// 当月
$where
=
[
[
'status'
,
'<='
,
4
],
[
'add_time'
,
'>='
,
self
::
$same_month_time_start
],
[
'add_time'
,
'<='
,
self
::
$same_month_time_end
],
];
$same_month_count
=
Db
::
name
(
'User'
)
->
where
(
$where
)
->
count
();
// 昨天
$where
=
[
[
'add_time'
,
'>='
,
self
::
$yesterday_time_start
],
...
...
@@ -141,6 +173,8 @@ class StatisticalService
// 数据组装
$result
=
[
'total_count'
=>
$total_count
,
'last_month_count'
=>
$last_month_count
,
'same_month_count'
=>
$same_month_count
,
'yesterday_count'
=>
$yesterday_count
,
'today_count'
=>
$today_count
,
];
...
...
@@ -148,7 +182,7 @@ class StatisticalService
}
/**
* 订单总数,今日,昨日,总数
* 订单总数,今日,昨日,
当月,上月
总数
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
...
...
@@ -162,13 +196,29 @@ class StatisticalService
// 订单状态
// (0待确认, 1已确认/待支付, 2已支付/待发货, 3已发货/待收货, 4已完成, 5已取消, 6已关闭)
// 总数
$where
=
[
[
'status'
,
'<='
,
4
],
];
$total_count
=
Db
::
name
(
'Order'
)
->
where
(
$where
)
->
count
();
// 上月
$where
=
[
[
'status'
,
'<='
,
4
],
[
'add_time'
,
'>='
,
self
::
$last_month_time_start
],
[
'add_time'
,
'<='
,
self
::
$last_month_time_end
],
];
$last_month_count
=
Db
::
name
(
'Order'
)
->
where
(
$where
)
->
count
();
// 当月
$where
=
[
[
'status'
,
'<='
,
4
],
[
'add_time'
,
'>='
,
self
::
$same_month_time_start
],
[
'add_time'
,
'<='
,
self
::
$same_month_time_end
],
];
$same_month_count
=
Db
::
name
(
'Order'
)
->
where
(
$where
)
->
count
();
// 昨天
$where
=
[
[
'status'
,
'<='
,
4
],
...
...
@@ -188,6 +238,8 @@ class StatisticalService
// 数据组装
$result
=
[
'total_count'
=>
$total_count
,
'last_month_count'
=>
$last_month_count
,
'same_month_count'
=>
$same_month_count
,
'yesterday_count'
=>
$yesterday_count
,
'today_count'
=>
$today_count
,
];
...
...
@@ -195,7 +247,7 @@ class StatisticalService
}
/**
* 订单成交总量,今日,昨日,总数
* 订单成交总量,今日,昨日,
当月,上月
总数
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
...
...
@@ -216,6 +268,22 @@ class StatisticalService
];
$total_count
=
Db
::
name
(
'Order'
)
->
where
(
$where
)
->
count
();
// 上月
$where
=
[
[
'status'
,
'='
,
4
],
[
'add_time'
,
'>='
,
self
::
$last_month_time_start
],
[
'add_time'
,
'<='
,
self
::
$last_month_time_end
],
];
$last_month_count
=
Db
::
name
(
'Order'
)
->
where
(
$where
)
->
count
();
// 当月
$where
=
[
[
'status'
,
'='
,
4
],
[
'add_time'
,
'>='
,
self
::
$same_month_time_start
],
[
'add_time'
,
'<='
,
self
::
$same_month_time_end
],
];
$same_month_count
=
Db
::
name
(
'Order'
)
->
where
(
$where
)
->
count
();
// 昨天
$where
=
[
[
'status'
,
'='
,
4
],
...
...
@@ -235,6 +303,8 @@ class StatisticalService
// 数据组装
$result
=
[
'total_count'
=>
$total_count
,
'last_month_count'
=>
$last_month_count
,
'same_month_count'
=>
$same_month_count
,
'yesterday_count'
=>
$yesterday_count
,
'today_count'
=>
$today_count
,
];
...
...
@@ -242,7 +312,7 @@ class StatisticalService
}
/**
* 订单收入总计,今日,昨日,总数
* 订单收入总计,今日,昨日,
当月,上月
总数
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
...
...
@@ -263,6 +333,22 @@ class StatisticalService
];
$total_count
=
Db
::
name
(
'Order'
)
->
where
(
$where
)
->
sum
(
'total_price'
);
// 上月
$where
=
[
[
'status'
,
'in'
,
[
2
,
3
,
4
]],
[
'add_time'
,
'>='
,
self
::
$last_month_time_start
],
[
'add_time'
,
'<='
,
self
::
$last_month_time_end
],
];
$last_month_count
=
Db
::
name
(
'Order'
)
->
where
(
$where
)
->
sum
(
'total_price'
);
// 当月
$where
=
[
[
'status'
,
'in'
,
[
2
,
3
,
4
]],
[
'add_time'
,
'>='
,
self
::
$same_month_time_start
],
[
'add_time'
,
'<='
,
self
::
$same_month_time_end
],
];
$same_month_count
=
Db
::
name
(
'Order'
)
->
where
(
$where
)
->
sum
(
'total_price'
);
// 昨天
$where
=
[
[
'status'
,
'in'
,
[
2
,
3
,
4
]],
...
...
@@ -282,6 +368,8 @@ class StatisticalService
// 数据组装
$result
=
[
'total_count'
=>
PriceNumberFormat
(
$total_count
),
'last_month_count'
=>
PriceNumberFormat
(
$last_month_count
),
'same_month_count'
=>
PriceNumberFormat
(
$same_month_count
),
'yesterday_count'
=>
PriceNumberFormat
(
$yesterday_count
),
'today_count'
=>
PriceNumberFormat
(
$today_count
),
];
...
...
changelog.txt
浏览文件 @
72557441
...
...
@@ -9,13 +9,15 @@
5. 网站首页可后台控制配置
web端
1.
1. 后台菜单支持自定义url地址、并支持钩子自动添加
2. 统计维度新增当月、上月
小程序
1. QQ小程序支持微信支付
插件
1. 汇率插件支持货币自由切换
2. 新增IEPay新西兰货币支付(支付宝+微信)
+=========================================================+
...
...
public/static/admin/default/css/index.init.css
浏览文件 @
72557441
...
...
@@ -98,19 +98,16 @@ html, body {
font-size
:
26px
;
font-weight
:
700
;
}
.shopxo-base
li
.li-content
p
,
.shopxo-base
li
.li-content
.
yesterday
,
.shopxo-base
li
.li-content
.today
{
.shopxo-base
li
.li-content
p
,
.shopxo-base
li
.li-content
.
item
{
text-overflow
:
ellipsis
;
overflow
:
hidden
;
white-space
:
nowrap
;
max-width
:
100%
;
}
.shopxo-base
li
.li-content
.
yesterday
,
.shopxo-base
li
.li-content
.today
{
.shopxo-base
li
.li-content
.
item
{
color
:
#f0f0f0
;
font-size
:
12px
;
}
.shopxo-base
li
.li-content
.yesterday
{
padding-bottom
:
5px
;
}
.shopxo-base
li
.li-content
.bg-icon
{
font-size
:
36px
;
position
:
absolute
;
...
...
sourcecode/baidu/pages/login/login.css
浏览文件 @
72557441
...
...
@@ -67,7 +67,7 @@ page{
*/
.confirm-container
.login-logo
{
width
:
200
rpx
;
height
:
200
rpx
;
height
:
200
rpx
!important
;
margin
:
0
auto
;
border-radius
:
50%
;
}
...
...
sourcecode/weixin/pages/login/login.wxss
浏览文件 @
72557441
...
...
@@ -67,7 +67,7 @@ page{
*/
.confirm-container .login-logo {
width: 200rpx;
height: 200rpx;
height: 200rpx
!important
;
margin: 0 auto;
border-radius: 50%;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录