Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
纵之格
ShopXO
提交
de48ea58
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,发现更多精彩内容 >>
提交
de48ea58
编写于
5月 12, 2019
作者:
G
gongfuxiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
钱包后台统计
上级
2e54aa4c
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
239 addition
and
75 deletion
+239
-75
application/plugins/view/wallet/admin/admin/index.html
application/plugins/view/wallet/admin/admin/index.html
+26
-73
application/plugins/wallet/admin/Admin.php
application/plugins/wallet/admin/Admin.php
+6
-1
application/plugins/wallet/service/BaseService.php
application/plugins/wallet/service/BaseService.php
+0
-1
application/plugins/wallet/service/StatisticalService.php
application/plugins/wallet/service/StatisticalService.php
+207
-0
未找到文件。
application/plugins/view/wallet/admin/admin/index.html
浏览文件 @
de48ea58
...
@@ -73,85 +73,38 @@
...
@@ -73,85 +73,38 @@
</div>
</div>
</div>
</div>
<!-- 管理 -->
<!--
统计面板/
管理 -->
<div
class=
"am-panel am-panel-secondary wallet-content-module"
>
<div
class=
"am-panel am-panel-secondary wallet-content-module"
>
<div
class=
"am-panel-hd"
>
<div
class=
"am-panel-hd"
>
<span
class=
"am-panel-title"
>
管理
</span>
<span
class=
"am-panel-title"
>
管理
</span>
</div>
</div>
<div
class=
"am-panel-bd"
>
<div
class=
"am-panel-bd"
>
<ul
data-am-widget=
"gallery"
class=
"am-gallery am-avg-sm-1 am-avg-md-2 am-avg-lg-2 am-gallery-default"
data-am-gallery=
"{ pureview: true }"
>
<ul
data-am-widget=
"gallery"
class=
"am-gallery am-avg-sm-1 am-avg-md-2 am-avg-lg-2 am-gallery-default"
data-am-gallery=
"{ pureview: true }"
>
<li
class=
"module-wallet"
>
{{if !empty($statistical)}}
<div
class=
"module-items"
>
{{foreach $statistical as $v}}
<p
class=
"title"
>
钱包总数
</p>
<li
class=
"module-wallet"
>
<p
class=
"total animation-count-to"
data-to=
"3"
data-speed=
"1500"
>
3
</p>
<div
class=
"module-items"
>
<div
class=
"small"
>
<p
class=
"title"
>
{{$v.title}}
</p>
<span>
昨日
</span>
<p
class=
"total animation-count-to"
data-to=
"{{$v.count}}"
data-speed=
"1500"
>
{{$v.count}}
</p>
<span
class=
"animation-count-to"
data-to=
"197"
data-speed=
"1500"
>
197
</span>
<div
class=
"small"
>
</div>
<span>
昨日
</span>
<div
class=
"small"
>
<span
class=
"animation-count-to"
data-to=
"{{$v.yesterday_count}}"
data-speed=
"1500"
>
{{$v.yesterday_count}}
</span>
<span>
今日
</span>
</div>
<span
class=
"animation-count-to"
data-to=
"35"
data-speed=
"1500"
>
35
</span>
<div
class=
"small"
>
</div>
<span>
今日
</span>
<div
class=
"top-right"
>
<span
class=
"animation-count-to"
data-to=
"{{$v.today_count}}"
data-speed=
"1500"
>
{{$v.today_count}}
</span>
<span>
用户
</span>
</div>
<span
class=
"animation-count-to"
data-to=
"12"
data-speed=
"1500"
>
12
</span>
{{if isset($v['right_count']) and isset($v['right_title'])}}
</div>
<div
class=
"top-right"
>
<a
href=
"{{:PluginsAdminUrl('wallet', 'wallet', 'index')}}"
class=
"view-to"
>
查看
<i
class=
"am-icon-angle-double-right"
></i></a>
<span>
{{$v.right_title}}
</span>
</div>
<span
class=
"animation-count-to"
data-to=
"{{$v.right_count}}"
data-speed=
"1500"
>
{{$v.right_count}}
</span>
</li>
</div>
<li
class=
"module-cash"
>
{{/if}}
<div
class=
"module-items"
>
<a
href=
"{{$v.url}}"
class=
"view-to"
>
查看
<i
class=
"am-icon-angle-double-right"
></i></a>
<p
class=
"title"
>
提现总数
</p>
</div>
<p
class=
"total animation-count-to"
data-to=
"3"
data-speed=
"1500"
>
3
</p>
</li>
<div
class=
"small"
>
{{/foreach}}
<span>
昨日
</span>
{{/if}}
<span
class=
"animation-count-to"
data-to=
"197"
data-speed=
"1500"
>
197
</span>
</div>
<div
class=
"small"
>
<span>
今日
</span>
<span
class=
"animation-count-to"
data-to=
"35"
data-speed=
"1500"
>
35
</span>
</div>
<div
class=
"top-right"
>
<span>
待处理
</span>
<span
class=
"animation-count-to"
data-to=
"12"
data-speed=
"1500"
>
12
</span>
</div>
<a
href=
"{{:PluginsAdminUrl('wallet', 'cash', 'index')}}"
class=
"view-to"
>
查看
<i
class=
"am-icon-angle-double-right"
></i></a>
</div>
</li>
<li
class=
"module-cash"
>
<div
class=
"module-items"
>
<p
class=
"title"
>
充值总数
</p>
<p
class=
"total animation-count-to"
data-to=
"3"
data-speed=
"1500"
>
3
</p>
<div
class=
"small"
>
<span>
昨日
</span>
<span
class=
"animation-count-to"
data-to=
"197"
data-speed=
"1500"
>
197
</span>
</div>
<div
class=
"small"
>
<span>
今日
</span>
<span
class=
"animation-count-to"
data-to=
"35"
data-speed=
"1500"
>
35
</span>
</div>
<div
class=
"top-right"
>
<span>
待支付
</span>
<span
class=
"animation-count-to"
data-to=
"12"
data-speed=
"1500"
>
12
</span>
</div>
<a
href=
"{{:PluginsAdminUrl('wallet', 'recharge', 'index')}}"
class=
"view-to"
>
查看
<i
class=
"am-icon-angle-double-right"
></i></a>
</div>
</li>
<li
class=
"module-cash"
>
<div
class=
"module-items"
>
<p
class=
"title"
>
账户明细总数
</p>
<p
class=
"total animation-count-to"
data-to=
"3"
data-speed=
"1500"
>
3
</p>
<div
class=
"small"
>
<span>
昨日
</span>
<span
class=
"animation-count-to"
data-to=
"197"
data-speed=
"1500"
>
197
</span>
</div>
<div
class=
"small"
>
<span>
今日
</span>
<span
class=
"animation-count-to"
data-to=
"35"
data-speed=
"1500"
>
35
</span>
</div>
<a
href=
"{{:PluginsAdminUrl('wallet', 'walletlog', 'index')}}"
class=
"view-to"
>
查看
<i
class=
"am-icon-angle-double-right"
></i></a>
</div>
</li>
</ul>
</ul>
</div>
</div>
</div>
</div>
...
...
application/plugins/wallet/admin/Admin.php
浏览文件 @
de48ea58
...
@@ -11,8 +11,9 @@
...
@@ -11,8 +11,9 @@
namespace
app\plugins\wallet\admin
;
namespace
app\plugins\wallet\admin
;
use
think\Controller
;
use
think\Controller
;
use
app\plugins\wallet\service\BaseService
;
use
app\service\PluginsService
;
use
app\service\PluginsService
;
use
app\plugins\wallet\service\BaseService
;
use
app\plugins\wallet\service\StatisticalService
;
/**
/**
* 钱包插件 - 管理
* 钱包插件 - 管理
...
@@ -37,6 +38,10 @@ class Admin extends Controller
...
@@ -37,6 +38,10 @@ class Admin extends Controller
if
(
$ret
[
'code'
]
==
0
)
if
(
$ret
[
'code'
]
==
0
)
{
{
$this
->
assign
(
'data'
,
$ret
[
'data'
]);
$this
->
assign
(
'data'
,
$ret
[
'data'
]);
// 统计数据
$this
->
assign
(
'statistical'
,
StatisticalService
::
StatisticalData
());
return
$this
->
fetch
(
'../../../plugins/view/wallet/admin/admin/index'
);
return
$this
->
fetch
(
'../../../plugins/view/wallet/admin/admin/index'
);
}
else
{
}
else
{
return
$ret
[
'msg'
];
return
$ret
[
'msg'
];
...
...
application/plugins/wallet/service/BaseService.php
浏览文件 @
de48ea58
...
@@ -13,7 +13,6 @@ namespace app\plugins\wallet\service;
...
@@ -13,7 +13,6 @@ namespace app\plugins\wallet\service;
use
think\Db
;
use
think\Db
;
use
app\service\ResourcesService
;
use
app\service\ResourcesService
;
use
app\plugins\wallet\service\WalletService
;
use
app\plugins\wallet\service\WalletService
;
use
app\plugins\wallet\service\PayService
;
use
app\plugins\wallet\service\CashService
;
use
app\plugins\wallet\service\CashService
;
use
app\plugins\wallet\service\RechargeService
;
use
app\plugins\wallet\service\RechargeService
;
...
...
application/plugins/wallet/service/StatisticalService.php
0 → 100644
浏览文件 @
de48ea58
<?php
// +----------------------------------------------------------------------
// | ShopXO 国内领先企业级B2C免费开源电商系统
// +----------------------------------------------------------------------
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: Devil
// +----------------------------------------------------------------------
namespace
app\plugins\wallet\service
;
use
think\Db
;
/**
* 统计服务层
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-01T21:51:08+0800
*/
class
StatisticalService
{
// 昨天日期
private
static
$yesterday_time_start
;
private
static
$yesterday_time_end
;
// 今天日期
private
static
$today_time_start
;
private
static
$today_time_end
;
/**
* 初始化
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2019-02-22
* @desc description
* @param [array] $params [输入参数]
*/
public
static
function
Init
(
$params
=
[])
{
static
$object
=
null
;
if
(
!
is_object
(
$object
))
{
// 初始化标记对象,避免重复初始化
$object
=
(
object
)
[];
// 昨天日期
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'
)));
// 今天日期
self
::
$today_time_start
=
strtotime
(
date
(
'Y-m-d 00:00:00'
));
self
::
$today_time_end
=
time
();
}
}
/**
* 数据总数,今日,昨日,总数
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-06T21:31:53+0800
* @param [array] $params [输入参数]
*/
public
static
function
YesterdayTodayTotal
(
$params
=
[])
{
// 扩展数据
$ext_count
=
0
;
// 操作类型
if
(
!
empty
(
$params
[
'type'
]))
{
switch
(
$params
[
'type'
])
{
// 钱包
case
'wallet'
:
$table
=
'PluginsWallet'
;
// 扩展数据
$ext_count
=
Db
::
name
(
'User'
)
->
count
();
break
;
// 提现申请
case
'cash'
:
$table
=
'PluginsWalletCash'
;
// 扩展数据
$ext_count
=
Db
::
name
(
$table
)
->
where
([
'status'
=>
0
])
->
count
();
break
;
// 充值
case
'recharge'
:
$table
=
'PluginsWalletRecharge'
;
// 扩展数据
$ext_count
=
Db
::
name
(
$table
)
->
where
([
'status'
=>
0
])
->
count
();
break
;
// 账户明细
case
'walletlog'
:
$table
=
'PluginsWalletLog'
;
break
;
}
}
if
(
empty
(
$table
))
{
return
DataReturn
(
'类型错误'
,
-
1
);
}
// 总数
$total_count
=
Db
::
name
(
$table
)
->
count
();
// 昨天
$where
=
[
[
'add_time'
,
'>='
,
self
::
$yesterday_time_start
],
[
'add_time'
,
'<='
,
self
::
$yesterday_time_end
],
];
$yesterday_count
=
Db
::
name
(
$table
)
->
where
(
$where
)
->
count
();
// 今天
$where
=
[
[
'add_time'
,
'>='
,
self
::
$today_time_start
],
[
'add_time'
,
'<='
,
self
::
$today_time_end
],
];
$today_count
=
Db
::
name
(
$table
)
->
where
(
$where
)
->
count
();
// 数据组装
$result
=
[
'total_count'
=>
$total_count
,
'yesterday_count'
=>
$yesterday_count
,
'today_count'
=>
$today_count
,
'ext_count'
=>
$ext_count
,
];
return
DataReturn
(
'处理成功'
,
0
,
$result
);
}
/**
* 获取统计数据
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-06T21:31:53+0800
* @param [array] $params [输入参数]
*/
public
static
function
StatisticalData
(
$params
=
[])
{
// 初始化
self
::
Init
(
$params
);
// 统计数据初始化
$result
=
[
'wallet'
=>
[
'title'
=>
'钱包总数'
,
'count'
=>
0
,
'yesterday_count'
=>
0
,
'today_count'
=>
0
,
'right_count'
=>
0
,
'right_title'
=>
'用户'
,
'url'
=>
PluginsAdminUrl
(
'wallet'
,
'wallet'
,
'index'
),
],
'cash'
=>
[
'title'
=>
'提现总数'
,
'count'
=>
0
,
'yesterday_count'
=>
0
,
'today_count'
=>
0
,
'right_count'
=>
0
,
'right_title'
=>
'待处理'
,
'url'
=>
PluginsAdminUrl
(
'wallet'
,
'cash'
,
'index'
),
],
'recharge'
=>
[
'title'
=>
'充值总数'
,
'count'
=>
0
,
'yesterday_count'
=>
0
,
'today_count'
=>
0
,
'right_count'
=>
0
,
'right_title'
=>
'待支付'
,
'url'
=>
PluginsAdminUrl
(
'wallet'
,
'recharge'
,
'index'
),
],
'walletlog'
=>
[
'title'
=>
'账户明细总数'
,
'count'
=>
0
,
'yesterday_count'
=>
0
,
'today_count'
=>
0
,
'url'
=>
PluginsAdminUrl
(
'wallet'
,
'walletlog'
,
'index'
),
],
];
$type_all
=
[
'wallet'
,
'cash'
,
'recharge'
,
'walletlog'
];
foreach
(
$type_all
as
$type
)
{
$ret
=
self
::
YesterdayTodayTotal
([
'type'
=>
$type
]);
if
(
$ret
[
'code'
]
==
0
)
{
$result
[
$type
][
'count'
]
=
$ret
[
'data'
][
'total_count'
];
$result
[
$type
][
'yesterday_count'
]
=
$ret
[
'data'
][
'yesterday_count'
];
$result
[
$type
][
'today_count'
]
=
$ret
[
'data'
][
'today_count'
];
if
(
isset
(
$result
[
$type
][
'right_count'
])
&&
isset
(
$ret
[
'data'
][
'ext_count'
]))
{
$result
[
$type
][
'right_count'
]
=
$ret
[
'data'
][
'ext_count'
];
}
}
}
return
$result
;
}
}
?>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录