mirror of
https://gitee.com/technical-laohu/mpay.git
synced 2025-11-11 21:23:42 +08:00
1、更新通道统计,可以查看每个通道的收入情况,可以查询指定时间段的通道收入情况
2、账号管理列表交互优化,添加操作下拉框 3、修复二维码图片上传功能可能导致的漏洞
This commit is contained in:
@@ -219,6 +219,11 @@
|
||||
let platformName = platforms[d.platform] || '已卸载';
|
||||
return `${platformName} [${d.aid}:${d.cid}]`;
|
||||
}
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
const where = {};
|
||||
urlParams.forEach((value, key) => {
|
||||
where[key] = value;
|
||||
});
|
||||
// 表格列参数
|
||||
let cols = [[
|
||||
{ type: 'checkbox' },
|
||||
@@ -239,6 +244,7 @@
|
||||
id: 'orders-table',
|
||||
elem: '#orders-table',
|
||||
url: '/api/Order/getOrders',
|
||||
where: where,
|
||||
page: true,
|
||||
cols: cols,
|
||||
skin: 'line',
|
||||
|
||||
@@ -106,10 +106,11 @@
|
||||
<script src="/component/layui/layui.js"></script>
|
||||
<script src="/component/pear/pear.js"></script>
|
||||
<script>
|
||||
layui.use(['table', 'form', 'common', 'util'], function () {
|
||||
layui.use(['table', 'form', 'common', 'dropdown', 'util'], function () {
|
||||
let table = layui.table;
|
||||
let form = layui.form;
|
||||
let common = layui.common;
|
||||
let dropdown = layui.dropdown;
|
||||
let util = layui.util;
|
||||
|
||||
// 渲染插件选项
|
||||
@@ -130,10 +131,11 @@
|
||||
{ title: '账 号', field: 'account', align: 'center' },
|
||||
{ title: '启用状态', field: 'state', align: 'center', templet: '#account-state' },
|
||||
{ title: '监听模式', field: 'pattern', align: 'center' },
|
||||
{ title: '监听地址 / 自定义模版', field: 'checkUrl', align: 'center', minWidth: 300, event: 'copy', templet: '#account-checkUrl' },
|
||||
{ title: '监听地址 / 自定义模版', field: 'checkUrl', align: 'center', minWidth: 240, event: 'copy', templet: '#account-checkUrl' },
|
||||
{ title: '收款平台流水', field: 'trade', align: 'center', templet: '#account-trade' },
|
||||
{ title: '收款码数量', field: 'channel', align: 'center', templet: '<div><a href="javascript:;" lay-event="channelList"><span class="layui-badge layui-bg-green">{{= d.channel }}</span></a></div>' },
|
||||
{ title: '操作', align: 'center', fixed: 'right', templet: '<div><a href="javascript:;" class="layui-font-green" lay-event="edit"><strong>编辑</strong></a></div>' }
|
||||
{ title: '收款码数量', field: 'channel_num', align: 'center', templet: '<div><a href="javascript:;" lay-event="channelList"><span class="layui-badge layui-bg-green">{{= d.channel_num }}</span></a></div>' },
|
||||
{ title: '今日收款', field: 'income', align: 'center', templet: '<div><strong>{{# return d.income ?? 0 }}</strong></div>' },
|
||||
{ title: '操作', align: 'center', fixed: 'right', templet: '<div><a href="javascript:;" class="layui-font-green edit" data-aid="{{= d.id }}"><strong>编辑</strong></a></div>' }
|
||||
]]
|
||||
|
||||
table.render({
|
||||
@@ -148,7 +150,17 @@
|
||||
title: '刷新',
|
||||
layEvent: 'refresh',
|
||||
icon: 'layui-icon-refresh',
|
||||
}, 'filter', 'print', 'exports']
|
||||
}, 'filter', 'print', 'exports'],
|
||||
done: function () {
|
||||
dropdown.render({
|
||||
elem: '.edit',
|
||||
align: 'center',
|
||||
data: [{ title: '编辑', id: 1 }, { type: '-' }, { title: '二维码', id: 2 }, { title: '收款统计', id: 3 }, { title: '收款明细', id: 4 }],
|
||||
click: function (data, othis) {
|
||||
account.doEdit(data, this.elem);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// 事件处理
|
||||
@@ -226,6 +238,27 @@
|
||||
// 操作方法
|
||||
let account = {};
|
||||
|
||||
// 编辑操作
|
||||
account.doEdit = function (data, elem) {
|
||||
const type = data.id;
|
||||
const id = elem.attr('data-aid');
|
||||
switch (type) {
|
||||
case 1:
|
||||
account.editAccount(id);
|
||||
break;
|
||||
case 2:
|
||||
account.channelList(id);
|
||||
break;
|
||||
case 3:
|
||||
alert('收款统计');
|
||||
break;
|
||||
case 4:
|
||||
account.orderList(id);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// 编辑
|
||||
account.editAccount = function (id) {
|
||||
layer.open({
|
||||
@@ -238,6 +271,18 @@
|
||||
});
|
||||
}
|
||||
// 终端列表
|
||||
account.orderList = function (aid) {
|
||||
// 先尝试关闭已存在的标签
|
||||
if (parent.layui.tab) {
|
||||
parent.layui.tab.delTabByElem('content', 'order');
|
||||
}
|
||||
// 重新打开标签
|
||||
parent.layui.tab.addTabOnlyByElem('content',
|
||||
{ id: 'order', title: '订单管理', url: `/Order/index?aid=${aid}`, close: true }
|
||||
)
|
||||
parent.layui.tab.changeTabTitleById('content', 'order', `【${aid}】订单明细`);
|
||||
}
|
||||
// 终端列表
|
||||
account.channelList = function (id) {
|
||||
layer.open({
|
||||
id: 'iframe-channel-list',
|
||||
|
||||
133
view/pay_manage/pay_statistics.html
Normal file
133
view/pay_manage/pay_statistics.html
Normal file
@@ -0,0 +1,133 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>收款管理</title>
|
||||
<link rel="stylesheet" href="/component/pear/css/pear.css" />
|
||||
<style>
|
||||
.account-trade {
|
||||
padding: 15px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body class="pear-container">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
<form class="layui-form layui-form-pane" action="" id="serch-form">
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">时间段</label>
|
||||
<div class="layui-inline" id="create_time">
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="time_start" autocomplete="off" placeholder="开始"
|
||||
class="layui-input">
|
||||
</div>
|
||||
<div class="layui-form-mid">-</div>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="time_end" autocomplete="off" placeholder="结束"
|
||||
class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<button type="submit" class="pear-btn pear-btn-md pear-btn-primary" lay-submit
|
||||
lay-filter="query">
|
||||
<i class="layui-icon layui-icon-search"></i>
|
||||
查询
|
||||
</button>
|
||||
<button type="button" lay-on="reset" class="pear-btn pear-btn-md">
|
||||
<i class="layui-icon layui-icon-refresh"></i>
|
||||
重置
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
<table id="account-table" lay-filter="account-table"></table>
|
||||
</div>
|
||||
</div>
|
||||
<script src="/component/layui/layui.js"></script>
|
||||
<script src="/component/pear/pear.js"></script>
|
||||
<script>
|
||||
layui.use(['table', 'form', 'common', 'dropdown', 'util'], function () {
|
||||
let table = layui.table;
|
||||
let form = layui.form;
|
||||
let common = layui.common;
|
||||
let dropdown = layui.dropdown;
|
||||
let util = layui.util;
|
||||
let laydate = layui.laydate;
|
||||
|
||||
|
||||
const now = new Date();
|
||||
const startOfDay = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 0, 0, 0);
|
||||
const endOfDay = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 23, 59, 59);
|
||||
laydate.render({
|
||||
elem: '#create_time',
|
||||
range: ['input[name="time_start"]', 'input[name="time_end"]'],
|
||||
rangeLinked: true,
|
||||
type: 'datetime',
|
||||
fullPanel: true,
|
||||
weekStart: 1,
|
||||
// 当天开始日期 - 当天结束日期
|
||||
value: util.toDateString(startOfDay, 'yyyy-MM-dd HH:mm:ss') + ' - ' + util.toDateString(endOfDay, 'yyyy-MM-dd HH:mm:ss')
|
||||
});
|
||||
|
||||
let cols = [[
|
||||
{ type: 'checkbox' },
|
||||
{ title: '平 台', field: 'platform', align: 'center', templet: '' },
|
||||
{ title: '账 号', field: 'account', align: 'center' },
|
||||
{ title: '时段查询收款', field: 'income', align: 'center', templet: '<div><strong>{{# return d.income ?? 0 }}</strong></div>' },
|
||||
{ title: '今日收款', field: 'day', align: 'center', templet: '<div><strong>{{# return d.day ?? 0 }}</strong></div>' },
|
||||
{ title: '昨日收款', field: 'yesterday', align: 'center', templet: '<div><strong>{{# return d.yesterday ?? 0 }}</strong></div>' },
|
||||
{ title: '本周收款', field: 'week', align: 'center', templet: '<div><strong>{{# return d.week ?? 0 }}</strong></div>' },
|
||||
{ title: '本月收款', field: 'month', align: 'center', templet: '<div><strong>{{# return d.month ?? 0 }}</strong></div>' },
|
||||
{ title: '当年收款', field: 'year', align: 'center', templet: '<div><strong>{{# return d.year ?? 0 }}</strong></div>' },
|
||||
{ title: '总计收款', field: 'total', align: 'center', templet: '<div><strong>{{# return d.total ?? 0 }}</strong></div>' },
|
||||
]]
|
||||
|
||||
table.render({
|
||||
id: 'account-table',
|
||||
elem: '#account-table',
|
||||
url: '/api/PayManage/payStatisticsList',
|
||||
page: true,
|
||||
cols: cols,
|
||||
skin: 'line',
|
||||
defaultToolbar: [{
|
||||
title: '刷新',
|
||||
layEvent: 'refresh',
|
||||
icon: 'layui-icon-refresh',
|
||||
}, 'filter', 'print', 'exports'],
|
||||
});
|
||||
|
||||
// 表单自定义事件监听
|
||||
form.on('submit(query)', function (obj) {
|
||||
const field = obj.field;
|
||||
let new_field = {};
|
||||
for (const key in field) {
|
||||
if (field.hasOwnProperty.call(field, key)) {
|
||||
const value = field[key];
|
||||
if (value) {
|
||||
new_field[key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
table.reload('account-table', { where: new_field });
|
||||
return false;
|
||||
});
|
||||
// 监听重置按钮
|
||||
util.on({
|
||||
reset: function () {
|
||||
document.querySelector('#serch-form').reset();
|
||||
table.reload('account-table', { where: {} });
|
||||
}
|
||||
});
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
BIN
view/view.zip
Normal file
BIN
view/view.zip
Normal file
Binary file not shown.
Reference in New Issue
Block a user