418 lines
16 KiB
PHP
418 lines
16 KiB
PHP
@extends('admin.layouts.base')
|
|
@section('add_css')
|
|
<style>
|
|
.layui-table-cell {
|
|
height: auto;
|
|
line-height: auto;
|
|
}
|
|
|
|
.layui-table-cell {
|
|
padding: 0 5px;
|
|
font-size: 13px;
|
|
|
|
}
|
|
|
|
.layui-table-header .layui-table-cell {
|
|
text-align: center;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.layui-table-total tr {
|
|
background: #fff !important;
|
|
color: #333;
|
|
font-weight: bold;
|
|
color: #f00;
|
|
|
|
}
|
|
|
|
.layui-table-total td {
|
|
border-color: #ededed;
|
|
}
|
|
</style>
|
|
@endsection
|
|
|
|
@section('content')
|
|
|
|
|
|
<div class="layui-card">
|
|
|
|
<div class="layui-form layui-form-pane search-form wid150 layui-card-header layuiadmin-card-header-auto">
|
|
|
|
<div class="layui-collapse" lay-filter="test">
|
|
<div class="layui-colla-item">
|
|
<h2 class="layui-colla-title">搜索展开</h2>
|
|
<div class="layui-colla-content layui-show">
|
|
<div class="layui-row">
|
|
<div class="layui-col-xs12 layui-col-sm6 layui-col-md3">
|
|
<div class="search-item">
|
|
<label class="">订单号</label>
|
|
<input type="text" name="order_sn" placeholder="请输入" autocomplete="off"
|
|
class="layui-input">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="layui-col-xs12 layui-col-sm6 layui-col-md3">
|
|
<div class="search-item">
|
|
<label class="">会员ID</label>
|
|
<input type="text" name="user_id" placeholder="请输入" autocomplete="off"
|
|
class="layui-input">
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="layui-col-xs12 layui-col-sm6 layui-col-md3">
|
|
<div class="search-item">
|
|
<label class="">本地回调</label>
|
|
<select name="notify_status">
|
|
<option value="">全部</option>
|
|
@if(count($order_notify)>0)
|
|
@foreach ($order_notify as $k=>$v)
|
|
<option value="{{ $k }}">{{ $v }}</option>
|
|
@endforeach
|
|
@endif
|
|
</select>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="layui-col-xs12 layui-col-sm6 layui-col-md3">
|
|
<div class="search-item">
|
|
<label class="">支付状态</label>
|
|
<select name="status">
|
|
<option value="">全部</option>
|
|
@if(count($order_status)>0)
|
|
@foreach ($order_status as $k=>$v)
|
|
<option value="{{ $k }}">{{ $v }}</option>
|
|
@endforeach
|
|
@endif
|
|
</select>
|
|
</div>
|
|
|
|
</div>
|
|
<div class="layui-col-xs12 layui-col-sm6 layui-col-md4">
|
|
<div class="search-item">
|
|
<label class="">时间范围</label>
|
|
<input type="text" class="layui-input" name="time" autocapitalize="none" readonly
|
|
id="test15" placeholder=" ~ ">
|
|
</div>
|
|
|
|
</div>
|
|
<div class="layui-col-xs12 layui-col-sm12 layui-col-md8">
|
|
<div class="search-item">
|
|
<div class="m-t-l-10">
|
|
<button class="layui-btn layui-btn-sm" data-doing="1" data-type="day"
|
|
data-value="0">今天
|
|
</button>
|
|
<button class="layui-btn layui-btn-sm" data-doing="1" data-type="day"
|
|
data-value="-1">昨天
|
|
</button>
|
|
<button class="layui-btn layui-btn-sm" data-doing="1" data-type="day"
|
|
data-value="-6">最近7天
|
|
</button>
|
|
<button class="layui-btn layui-btn-sm" data-doing="1" data-type="month"
|
|
data-value="0">本月
|
|
</button>
|
|
<button class="layui-btn layui-btn-sm" data-doing="1" data-type="month"
|
|
data-value="-1">上月
|
|
</button>
|
|
<button class="layui-btn layui-btn-sm" data-doing="1" data-type="month"
|
|
data-value="-3">前3月
|
|
</button>
|
|
<button class="layui-btn layuiadmin-btn-admin" lay-submit lay-filter="LAY-list-search"
|
|
style="margin-left: 20px">
|
|
<i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
|
|
</button>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
<div class="layui-card-body">
|
|
<table id="LAY-list-table" lay-filter="LAY-list-table"></table>
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
@endsection
|
|
@section('add_js')
|
|
@verbatim
|
|
<script type="text/html" id="tpl_order_time">
|
|
<p class="">下单:{{ d.order_at || '' }}</p>
|
|
<p class="">支付:{{ d.pay_ok_at || '' }}</p>
|
|
<p class="text-info">结算:{{ d.success_at || '' }}</p>
|
|
</script>
|
|
<script type="text/html" id="tpl_order_sn">
|
|
<p class="text-blue" lay-event="openLayer" data-w="70%" data-h="60%" data-url="{{ d.show_url }}"
|
|
data-title="查看{{ d.order_sn }}订单详情">本站:{{ d.order_sn || '' }}</p>
|
|
<p class="">流水:{{ d.pay_order_sn || '' }}</p>
|
|
</script>
|
|
<script type="text/html" id="tpl_order_ratio">
|
|
<p class="2222">平台手续费:{{ d.pay_rate || '' }}</p>
|
|
<p class="2222">平台费率:<b class="text-blue">{{ (d.ratio/10) || '' }}%</b></p>
|
|
|
|
</script>
|
|
<script type="text/html" id="table-useradmin-admin2">
|
|
{{# if(d.pay_status!=1){ }}
|
|
<a href="javascript:void(0)" data-status="pay" lay-event="order_handle"
|
|
class="layui-btn layui-btn-sm layui-btn-primary">更新支付</a>
|
|
{{# } }}
|
|
|
|
</script>
|
|
|
|
|
|
@endverbatim
|
|
|
|
@include('admin.layouts.common_index')
|
|
<script>
|
|
listConfig.open_width = '660px';
|
|
listConfig.open_height = '450px';
|
|
listable_url = "{{ action($controller.'@apiJson',request()->only(['day','pay_status','notify_status','out_notify_status','location'])) }}";
|
|
is_location="{{ request()->input('location') }}";
|
|
|
|
layui.use(['index', 'table', 'listable', 'custorm', 'laydate'], function () {
|
|
var $ = layui.$
|
|
, listable = layui.listable
|
|
, table = layui.table;
|
|
var laydate = layui.laydate;
|
|
var custorm = layui.custorm;
|
|
laydate.render({
|
|
elem: '#test15'
|
|
, type: 'datetime'
|
|
, range: '~'
|
|
, format: 'yyyy-MM-dd HH:mm:ss'
|
|
});
|
|
|
|
cols = [[
|
|
|
|
{field: 'id', width: 40, title: 'ID', sort: true}
|
|
, {
|
|
field: 'pay_type_name', title: '类型', width: 60, templet: function (d) {
|
|
if (d.pay_type == 'weixin') {
|
|
return '<span class="layui-badge layui-bg-green">' + d.pay_type_name + '</span>';
|
|
}
|
|
if (d.pay_type == 'alipay') {
|
|
return '<span class="layui-badge layui-bg-blue">' + d.pay_type_name + '</span>';
|
|
}
|
|
}
|
|
}
|
|
|
|
, {field: 'created_at', title: '订单时间', width: 200, templet: "#tpl_order_time"}
|
|
, {field: 'roles_name', title: '订单号', templet: '#tpl_order_sn', minWidth: 220}
|
|
, {field: 'order_money', title: '订单金额', width: 90, align: "center", totalRow: true}
|
|
, {field: 'pay_money', title: '实付金额', width: 90, align: "center", totalRow: true}
|
|
, {
|
|
field: 'pay_rate',
|
|
title: '手续/扣点',
|
|
templet: '#tpl_order_ratio',
|
|
align: "center",
|
|
width: 150,
|
|
totalRow: true
|
|
|
|
}
|
|
, {field: 'total_money', title: '结算金额', width: 90, align: "center", totalRow: true}
|
|
, {field: 'username', title: '姓名', width: 100, align: "center"}
|
|
, {field: 'order_status_name', title: '状态', align: "center", width: 150}
|
|
, {
|
|
minWidth: 250,
|
|
field: 'server_name',
|
|
title: '操作',
|
|
align: 'center',
|
|
toolbar: '#table-useradmin-admin2',
|
|
}
|
|
]];
|
|
|
|
listable.list(listable_url, cols, {
|
|
// totalRow: 1
|
|
});
|
|
|
|
|
|
custorm.diy_open(".diyopen");
|
|
|
|
//顶部添加和删除事件
|
|
listable.top_handle();
|
|
|
|
//监听搜索
|
|
listable.search();
|
|
|
|
$("[data-doing]").click(function () {
|
|
$(this).addClass('layui-btn-normal').siblings().removeClass('layui-btn-normal');
|
|
var type = $(this).data('type');
|
|
var value = $(this).data('value');
|
|
data = {
|
|
[type]: value,
|
|
};
|
|
if (type == 'day') {
|
|
data.month = '';
|
|
}
|
|
if (type == 'month') {
|
|
data.day = '';
|
|
}
|
|
table.reload('LAY-list-table', {
|
|
where: data
|
|
});
|
|
});
|
|
|
|
|
|
function total(){
|
|
$.ajax({
|
|
url: "{{ admin_url('Statis','index',['type'=>'order','method'=>'orderIndexStatis']) }}",
|
|
type: 'get',
|
|
data: {
|
|
month:0
|
|
|
|
},
|
|
success: function (res) {
|
|
console.log(res);
|
|
if (res.error == 0) {
|
|
|
|
for (var i in res.data)
|
|
{
|
|
$('#'+i).text(res.data[i])
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
});
|
|
}
|
|
|
|
|
|
//监听表操作
|
|
extend_fun = function (obj, that) {
|
|
var data = obj.data;
|
|
|
|
if (obj.event === 'order_handle') {
|
|
var status = that.data('status');
|
|
var value = that.data('value');
|
|
var open_layer = 0;
|
|
var url = '';
|
|
var post_url = '';
|
|
switch (status) {
|
|
case 'pay':
|
|
url = data.update_pay_url;
|
|
post_url = data.update_pay_post_url;
|
|
open_layer = 1;
|
|
config = {
|
|
type: 2,
|
|
title: '更新支付状态',
|
|
url: url,
|
|
h: '500px',
|
|
w: '400px',
|
|
btn: ['确定', '取消']
|
|
};
|
|
break;
|
|
case 'notify':
|
|
open_layer = 2;
|
|
post_url = data.update_notify_url;
|
|
config = {
|
|
btn: ['立即发送', '稍后操作'],
|
|
content: '<h3 class="text-center">确定更新外部回调吗?</h3>'
|
|
|
|
};
|
|
|
|
break;
|
|
|
|
|
|
case 'payfor':
|
|
open_layer = 1;
|
|
url = data.update_payfor_url;
|
|
post_url = data.update_payfor_post_url;
|
|
config = {
|
|
type: 2,
|
|
title: '结算订单',
|
|
url: url,
|
|
h: '500px',
|
|
w: '400px',
|
|
btn: ['确定', '取消']
|
|
};
|
|
break;
|
|
|
|
|
|
}
|
|
if (open_layer == 2) {
|
|
func = function (index, layero) {
|
|
$.ajax({
|
|
url: post_url,
|
|
type: 'post',
|
|
data: {
|
|
order_id: data.id
|
|
},
|
|
success: function (res) {
|
|
layer.msg(res.msg);
|
|
if (res.error == 0) {
|
|
table.reload('LAY-list-table');
|
|
layer.close(index); //关闭弹层
|
|
}
|
|
}
|
|
|
|
});
|
|
};
|
|
|
|
layer.open({
|
|
type: 0,
|
|
closeBtn: config.closeBtn || 0,
|
|
shade: 0.3,
|
|
title: false,
|
|
btnAlign: 'c',
|
|
btn: config.btn,
|
|
content: config.content,
|
|
yes: func,
|
|
btn2: config.btn2 || function (index, layero) {
|
|
layer.closeAll();
|
|
}
|
|
|
|
});
|
|
} else if (open_layer == 1) {
|
|
func = function (layero, index) {
|
|
var iframeWindow = window['layui-layer-iframe' + index],
|
|
submit = layero.find('iframe').contents().find("#LAY-form-submit");
|
|
//监听提交
|
|
iframeWindow.layui.form.on('submit(LAY-form-submit)', function (data) {
|
|
var field = data.field; //获取提交的字段
|
|
$.ajax({
|
|
url: post_url,
|
|
type: 'post',
|
|
data: field,
|
|
success: function (res) {
|
|
layer.msg(res.msg);
|
|
if (res.error == 0) {
|
|
table.reload('LAY-list-table');
|
|
layer.close(index); //关闭弹层
|
|
}
|
|
}
|
|
|
|
});
|
|
});
|
|
submit.trigger('click');
|
|
};
|
|
custorm.layer_open(config, config.func || func);
|
|
}
|
|
|
|
|
|
}
|
|
|
|
};
|
|
listable.handle(extend_fun);
|
|
});
|
|
</script>
|
|
@endsection |