466 lines
20 KiB
PHP
466 lines
20 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-collapse" lay-accordion>
|
||
<div class="layui-colla-item">
|
||
<h2 class="layui-colla-title">搜索</h2>
|
||
<div class="layui-colla-content layui-show">
|
||
<form class="layui-form layui-form-pane layui-card-header layuiadmin-card-header-auto">
|
||
<div class="layui-form-item">
|
||
<div class="layui-inline">
|
||
<label class="layui-form-label">推广商户</label>
|
||
<div class="layui-input-block">
|
||
<select name="from_merchant_id">
|
||
<option value="">全部</option>
|
||
@if(count($merchant)>0)
|
||
@foreach ($merchant as $k=>$v)
|
||
<option value="{{ $v['id'] }}">{{ $v['name'] }}</option>
|
||
@endforeach
|
||
@endif
|
||
</select>
|
||
</div>
|
||
</div>
|
||
|
||
|
||
<div class="layui-inline">
|
||
<label class="layui-form-label">订单号</label>
|
||
<div class="layui-input-block">
|
||
<input type="text" name="order_sn" placeholder="请输入" autocomplete="off"
|
||
class="layui-input">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="layui-inline">
|
||
<label class="layui-form-label">订单金额</label>
|
||
<div class="layui-input-block">
|
||
<input type="text" name="order_money" placeholder="请输入" autocomplete="off"
|
||
class="layui-input">
|
||
</div>
|
||
</div>
|
||
|
||
|
||
<div class="layui-inline">
|
||
<label class="layui-form-label">支付状态</label>
|
||
<div class="layui-input-block">
|
||
<select name="pay_status">
|
||
<option value="">全部</option>
|
||
@if(count($pay_status)>0)
|
||
@foreach ($pay_status as $k=>$v)
|
||
<option value="{{ $k }}">{{ $v }}</option>
|
||
@endforeach
|
||
@endif
|
||
</select>
|
||
</div>
|
||
</div>
|
||
<div class="layui-inline">
|
||
<label class="layui-form-label">订单状态</label>
|
||
<div class="layui-input-block">
|
||
<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-inline">
|
||
<label class="layui-form-label">时间</label>
|
||
<div class="layui-input-block">
|
||
<input type="text" name="time" id="test15" readonly placeholder="请输入"
|
||
autocomplete="off"
|
||
class="layui-input">
|
||
</div>
|
||
</div>
|
||
<div class="layui-inline">
|
||
|
||
<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>
|
||
|
||
|
||
</div>
|
||
|
||
|
||
</div>
|
||
<div class="layui-form-item">
|
||
<div class="layui-inline">
|
||
<button class="layui-btn layuiadmin-btn-admin" lay-submit lay-filter="LAY-list-search"
|
||
style="">
|
||
<i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
|
||
</button>
|
||
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
|
||
</div>
|
||
</div>
|
||
|
||
</form>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
|
||
<div class="layui-card-body">
|
||
<div class="msg-tips msg-tips-warm">
|
||
<p><i class="layui-icon layui-icon-about"></i> <b>盈利佣金:</b>扣除了通道成本费用<br/><b>盈利比例:</b>平台费率扣除通道费率</p>
|
||
<p>例如:给代理3%,代理给商户4%,那么这个商户成交,平台费率按3%计算,多出的部分,返给代理作为佣金</p>
|
||
</div>
|
||
<table id="LAY-list-table" lay-filter="LAY-list-table" class="table-responsive"></table>
|
||
|
||
</div>
|
||
|
||
|
||
</div>
|
||
|
||
|
||
|
||
|
||
|
||
@endsection
|
||
@section('add_js')
|
||
@verbatim
|
||
<script type="text/html" id="tpl_order_time">
|
||
<div class="text-left">
|
||
<p class="">下单:{{ d.created_at || '' }}</p>
|
||
<p class="">通道:{{ d.gateway_name || '' }}</p>
|
||
<p class="" style="color: #f60;">通道账号:{{ d.gateway_mch_id || '' }}</p>
|
||
<p class="">通道ID:{{ d.gateway_id || '' }}</p>
|
||
</div>
|
||
|
||
</script>
|
||
<script type="text/html" id="tpl_order_sn">
|
||
<div class="text-left">
|
||
<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>
|
||
</div>
|
||
</script>
|
||
<script type="text/html" id="tpl_order_ratio">
|
||
<div class="text-center">
|
||
<p class="2222">总费率:<b class="text-danger">{{ (d.ratio/10) }}%</b></p>
|
||
<p class="2222">平台手续费:{{ d.pay_rate || '' }}</p>
|
||
<p class="2222">平台费率:{{ (d.system_ratio/10) || '' }}%</p>
|
||
{{# if(d.up_ratio!=0){ }}
|
||
<p class="2222">上浮费率:{{ (d.up_ratio/10) || '' }}%</p>
|
||
<p class="2222">原费率:{{ (d.original_ratio/10) || '' }}%</p>
|
||
{{#} }}
|
||
<p>盈利费率:{{ d.final_ratio/10 }}%</p>
|
||
<p>盈利佣金:<b class="text-blue">{{ d.final_money }}</b></p>
|
||
{{# if(d.next_money!=0 && d.dali_id!=0){ }}
|
||
<p class="2222">代理佣金:{{ d.next_money || '' }}</p>
|
||
<p class="2222">代理盈利费率:{{ (d.next_ratio/10) || '' }}%</p>
|
||
{{#} }}
|
||
{{# if(d.top_money!=0){ }}
|
||
<p class="2222">股东佣金:{{ d.top_money || '' }}</p>
|
||
<p class="2222">股东盈利费率:{{ (d.top_ratio/10) || '' }}%</p>
|
||
{{#} }}
|
||
</div>
|
||
</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>
|
||
{{# } }}
|
||
|
||
{{# if(d.out_notify_status!=1 && d.pay_status==1){ }}
|
||
<a href="javascript:void(0)" data-status="notify" data-value="2" 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: 100, templet: function (d) {
|
||
var type_str = '';
|
||
if (d.pay_type == 'weixin') {
|
||
type_str = '<p><span class="layui-badge layui-bg-green">' + d.pay_type_name + '</span></p>';
|
||
}
|
||
if (d.pay_type == 'alipay') {
|
||
type_str = '<p><span class="layui-badge layui-bg-blue">' + d.pay_type_name + '</span></p>';
|
||
}
|
||
if (d.pay_type == 'tr_alipay') {
|
||
type_str = '<p><span class="layui-badge layui-bg-blue">固码支付宝</span></p>';
|
||
}
|
||
if (d.pay_type == 'tr_weixin') {
|
||
type_str = '<p><span class="layui-badge layui-bg-green">固码微信</span></p>';
|
||
}
|
||
if (d.pay_type == 'tr_bank') {
|
||
type_str = '<p><span class="layui-badge layui-bg-green">固码银行</span></p>';
|
||
}
|
||
type_str += d.gateway_method_name;
|
||
return type_str;
|
||
}
|
||
}
|
||
, {field: 'order_status_name2', title: '状态', align: "center", width: 120}
|
||
, {field: 'merchants2_name', title: '推广服务商', width: 120, align: "center"}
|
||
, {field: 'merchants_name', title: '付款商户', align: "center", width: 120}
|
||
, {field: 'created_at', title: '订单时间', width: 150, templet: "#tpl_order_time"}
|
||
, {field: 'roles_name', title: '订单号', templet: '#tpl_order_sn', minWidth: 180}
|
||
, {field: 'money', title: '订单金额', width: 120, align: "center", totalRow: true}
|
||
, {field: 'pay_money', title: '实付金额', width: 120, align: "center", totalRow: true}
|
||
, {field: 'system_money', title: '系统佣金', width: 120, align: "center", totalRow: true}
|
||
, {field: 'merchant_money', title: '商户推广佣金', width: 120, align: "center", totalRow: true}
|
||
|
||
|
||
]];
|
||
|
||
listable.list(listable_url, cols, {
|
||
totalRow: 1
|
||
});
|
||
|
||
|
||
custorm.diy_open(".diyopen");
|
||
|
||
//顶部添加和删除事件
|
||
listable.top_handle();
|
||
|
||
//监听搜索
|
||
listable.search();
|
||
|
||
$("[data-doing]").click(function () {
|
||
$(this).addClass('layui-btn-default').siblings().removeClass('layui-btn-default');
|
||
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
|
||
});
|
||
return false;
|
||
});
|
||
//统计请求
|
||
// total('order_money',"#month_order_money");
|
||
// total('pay_money',"#month_pay_money");
|
||
// total('pay_rate',"#month_pay_pate");
|
||
// total('next_money',"#day_pay_pate");
|
||
// total('total_money',"#day_total_money");
|
||
if (!is_location) {
|
||
total();
|
||
}
|
||
|
||
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 |