You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

600 lines
25 KiB
HTML

<extend name="Public/base"/>
<block name="css">
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" />
<style>
.select2-container--default .select2-selection--single {
color: #000;
resize: none;
border-width: 1px;
border-style: solid;
border-color: #a7b5bc #ced9df #ced9df #a7b5bc;
box-shadow: 0px 3px 3px #F7F8F9 inset;height:35px;
height:28px;border-radius:3px;font-size:12px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
line-height:35px;
line-height:28px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
height:26px;
}
.select2-container--default .select2-search--dropdown .select2-search__field {
height:26px;line-height:26px;font-size:12px;
}
.select2-results__option[aria-selected] {font-size:12px;}
</style>
</block>
<block name="body">
<script type="text/javascript" src="__JS__/bootstrap.min.js"></script>
<script type="text/javascript" src="__JS__/select2.min.js"></script>
<div class="cf main-place top_nav_list navtab_list">
<div class="fr">
<a <if condition="$group eq 1"> class="tabchose" </if> href="{:U('settlement?group=1')}">推广结算</a>
<a <if condition="$group eq 2"> class="tabchose" </if> href="{:U('settlement?group=2')}">结算记录</a>
</div>
<h3 class="page_title">推广结算</h3>
<if condition="$group eq 1">
<p class="description_text">说明:此功能是查看所有的会长未提现订单,并可进行后台提现</p>
<else/>
<p class="description_text">说明:此功是查看所有会长的结算记录</p>
</if>
</div>
<div class="cf top_nav_list">
<div class="fl button_list">
<div class="tools">
<if condition="I('group') eq 1 or $group eq 1">
<a id="withdraw"><span class="button_icon button_icon10"></span>提 现</a>
</if>
</div>
</div>
<div class="jssearch fl cf search_list">
<div class="input-list search-title-box">
<label>搜索:</label>
</div>
<div class="input-list input-list-promote search_label_rehab">
<select id="promote_id" name="promote_id" class="select_gallery" style="width:120px;">
<option value="">会长账号</option>
<volist name=":get_promote_list_by_id()" id="vo">
<option promote-id="{$vo.id}" value="{$vo.id}">{$vo.account}</option>
</volist>
</select>
</div>
<if condition="I('group') eq 1 or $group eq 1">
<div class="input-list input-list-promote search_label_rehab">
<select id="settlement_type" name="settlement_type" class="select_gallery" style="width:120px;">
<option value="">提现模式</option>
<?php foreach ($settlementTypeList as $key => $vo) :?>
<option value="{$key}">{$vo}</option>
<?php endforeach ;?>
</select>
</div>
<div class="input-list" id="pay_time">
<input type="text" class="txt range-date" id="time" name="time" placeholder="充值时间" value="{:I('time')}" style="width: 180px;" readonly="readonly">
</div>
</if>
<if condition="I('group') eq 2 or $group eq 2">
<div class="input-list">
<input type="text" id="create_time" name="create_time" class="" value="{:I('create_time', '')}" placeholder="提现时间" />
</div>
</if>
<input type="hidden" id="sort_by" name="sort_by" value="{:I('sort_by', '')}" class="sortBy">
<input type="hidden" id="sort_column" name="sort_column" value="{:I('sort_column', '')}" class="sortBy">
<if condition="I('group') eq 1 or $group eq 1">
<div class="input-list">
<a class="sch-btn" href="javascript:;" id="search" url="{:U('Query/settlement?group=1','model='.$model['name'] .'&row='.I('row'),false)}">搜索</a>
</div>
</if>
<if condition="I('group') eq 2 or $group eq 2">
<div class="input-list">
<input type="text" name="widthdraw_number" class="" value="{:I('widthdraw_number')}" placeholder="提现单号">
</div>
<div class="input-list">
<select name="status" class="select_gallery">
<option value="">提现状态</option>
<?php foreach (promoteWithdrawStatus() as $key => $value) :?>
<option value="<?=$key?>"><?=$value?></option>
<?php endforeach;?>
</select>
</div>
<div class="input-list">
<select name="op_type" class="select_gallery">
<option value="">操作人类型</option>
<?php foreach (getPromoteWithdrawOpType() as $key => $value) :?>
<option value="<?=$key?>"><?=$value?></option>
<?php endforeach;?>
</select>
</div>
<div class="input-list">
<select name="settlement_type" class="select_gallery">
<option value="">提现模式</option>
<?php foreach ($settlementTypeList as $key => $vo) :?>
<option value="{$key}">{$vo}</option>
<?php endforeach ;?>
</select>
</div>
<div class="input-list">
<a class="sch-btn" href="javascript:;" id="search" url="{:U('Query/settlement?group=2','model='.$model['name'] .'&row='.I('row'),false)}">搜索</a>
</div>
</if>
</div>
</div>
<!-- 数据列表 -->
<div class="data_list">
<div class="">
<if condition="$group eq 1">
<table>
<!-- 表头 -->
<thead>
<tr>
<th >日期</th>
<th >会长账号</th>
<th >游戏名称</th>
<th ><a class="paixu" data-order='sum_amount'>总充值</a></th>
<th ><a class="paixu" data-order='user_num'>总注册</a></th>
<th >结算模式</th>
<th >分成比例</th>
<th >结算金额</th>
</tr>
</thead>
<!-- 列表 -->
<tbody>
<style>
.data-table thead th, .data-table tbody td{text-align:center}
.data-table tbody td{border-right:1px solid #DDDDDD;}
.d_list .drop-down ul {z-index:999;}
</style>
<empty name ="records">
<td colspan="12" class="text-center">aOh! 暂时还没有内容!</td>
<else />
<volist name="records" id="record">
<tr>
<td>{$record.day}</td>
<td>{$record.promote_account}</td>
<td>{$record.game_name}</td>
<td>{$record['sum_amount']|default=0}</td>
<td>{$record['user_num']|default=0}</td>
<td class="cooperation">CPS</td>
<td>{$record['selle_ratio']|default=0}%</td>
<td class="money">
{$record['settlement_amount']}
</td>
</tr>
</volist>
<tr class="data_summary">
<td>汇总</td>
<td colspan="10">
<if condition="3 eq I('settlement_type', 0)">
累计充值:{$zTotal}元
<else/>
累计结算:{$zTotal}元
</if>
</td>
</tr>
</empty>
</tbody>
</table>
</if>
<if condition="$group eq 2">
<table>
<!-- 表头 -->
<thead>
<tr>
<th>推广员账号</th>
<th>结算单号</th>
<th>结算金额</th>
<th>操作人</th>
<th>操作人类型</th>
<th>最后操作人</th>
<th>最后操作人类型</th>
<th>提现模式</th>
<th>结算开始时间</th>
<th>结算截止时间</th>
<th>提现时间</th>
<th>提现状态</th>
<th>说明</th>
<th>操作</th>
</tr>
</thead>
<!-- 列表 -->
<tbody>
<volist name="records" id="record">
<tr>
<td>{$record.promote_account}</td>
<td>{$record.widthdraw_number}</td>
<td>{$record.sum_money}</td>
<td>{$record.op_id_text}</td>
<td>{$record.op_type_text}</td>
<td>{$record.last_op_id_text}</td>
<td>{$record.last_op_type_text}</td>
<td>{$record.settlement_type_text}</td>
<td>{$record.settlement_begin_time}</td>
<td>{$record.settlement_end_time}</td>
<td>{$record.create_time}</td>
<td>{$record.status_text}</td>
<td>{$record.respond}</td>
<td>
<if condition="$record['status'] eq -1">
<span class="renew-review" data-id="{$record['id']}" style="color: #0bb20c;cursor: pointer;">重新审核</span>
</if>
<if condition="$record['status'] eq -1 or $record['status'] eq 0">
<span class="cancel-withdraw" data-id="{$record['id']}" style="color: red;cursor: pointer;">撤销提现</span>
</if>
</td>
</tr>
</volist>
</tbody>
</table>
</if>
</div>
</div>
<div class="page">
<if condition="$role_export_check eq true ">
<a class="sch-btn export-btn"
href="{:U(CONTROLLER_NAME.'/'.ACTION_NAME,array_merge(['export'=>1, 'group' => I('group', 1)], I('get.')))}" target="_blank">导出</a>
</if>
{$_page|default=''}
</div>
<div class="common_settings">
<span class="plus_icon"><span><img src="__IMG__/zwmimages/icon_jia.png"></span></span>
<form class="addShortcutIcon">
<input type="hidden" name="title" value="{$m_title}">
<input type="hidden" name="url" value="Query/settlement">
</form>
<a class="ajax-post add-butn <notempty name='commonset'>addSIsetted</notempty>" href="javascript:;" target-form="addShortcutIcon" url="{:U('Think/addShortcutIcon')}"><img src="__IMG__/zwmimages/icon_jia.png"><span><notempty name='commonset'>已添加<else />添加至常用设置</notempty></span></a>
</div>
</block>
<block name="script">
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<php>if(C('COLOR_STYLE')=='blue_color') echo '<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">';</php>
<script src="__STATIC__/layer/layer.js" type="text/javascript"></script>
<script type="text/javascript" src="__STATIC__/layer/extend/layer.ext.js" ></script>
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
<script src="__STATIC__/layer/layer.js" type="text/javascript"></script>
<link rel="stylesheet" href="__STATIC__/flatpickr/flatpickr.min.css">
<script src="__STATIC__/flatpickr/flatpickr.min.js"></script>
<script src="__STATIC__/flatpickr/l10n/zh.js"></script>
<script>
<volist name = ":I('get.')" id = "vo">
Think.setValue('{$key}', "{$vo}");
</volist>
$(".select_gallery").select2();
</script>
<script type="text/javascript">
</script>
<script type="text/javascript">
//导航高亮
highlight_subnav("{:U('Query/settlement')}");
$(function(){
//搜索功能
$("#search").click(function(){
var url = $(this).attr('url');
var query = $('.top_nav_list').find('input').serialize();
var promoteId = $('#promote_id').val();
var settlementType = $('#settlement_type').val();
var time = $('#time').val();
var group = parseInt("{$group}");
if (promoteId == '' && group === 1) {
layer.msg('请选择推广员', {time: 1000});
return false;
}
if (settlementType == '') {
layer.msg('请选择提现模式', {time: 1000});
return false;
}
if (time == '') {
layer.msg('请选择充值时间', {time: 1000});
return false;
}
query += "&"+$('.top_nav_list').find('select').serialize();
query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
query = query.replace(/^&/g,'');
if( url.indexOf('?')>0 ){
url += '&' + query;
}else{
url += '?' + query;
}
window.location.href = url;
});
$(".paixu").click(function(){
var that = $(this);
var sortBy = $('#sort_by');
var sortColumn = $('#sort_column');
var dataOrder = that.attr('data-order');
var orderType = parseInt(sortBy.val());
if (dataOrder === sortColumn.val()) {
if (orderType === 1) {
orderType = 2;
} else {
orderType = 1;
}
} else {
orderType = 1;
}
sortBy.val(orderType);
sortColumn.val(dataOrder);
$("#search").click();
});
//回车自动提交
$('.jssearch').find('input').keyup(function(event){
if(event.keyCode===13){
$("#search").click();
}
});
var date="{$setdate}";
$('#create_time').datetimepicker({
format: 'yyyy-mm-dd',
language:"zh-CN",
minView:2,
autoclose:true,
scrollMonth:false,
scrollTime:false,
scrollInput:false,
endDate:date
});
switch (parseInt("{:(I('settlement_type', 0))}")) {
case 1:
setTimeByWeek();
break;
case 2:
case 3:
setTimeByMonth();
break;
default:
setTimeByWeek();
break;
}
});
function setTimeByWeek() {
var defaultDate = $('#time').val()
defaultDate = defaultDate == '' ? [] : defaultDate.split(' 至 ')
$('#time').flatpickr({
mode: 'range',
locale: 'zh',
dateFormat: "Y-m-d",
defaultDate: defaultDate,
onChange: function (selectedDates, dateStr, instance) {
if (dateStr.indexOf('至') === -1) {
var thisDate = new Date(Date.parse(dateStr));
if (thisDate.getDay() !== 1) {
layer.msg('请选择周一到周日');
return false;
}
} else {
var thisDate = dateStr.split(' 至 ');
var startDate = new Date(Date.parse(thisDate[0]));
if (startDate.getDay() !== 1 || Date.parse(thisDate[1]) / 1000 - Date.parse(thisDate[0]) / 1000 !== 518400) {
layer.msg('请选择周一到周日');
$('#time').val('');
return false;
}
}
}
});
}
function setTimeByMonth() {
$('#time').datetimepicker({
format: 'yyyy-mm',
language: "zh-CN",
autoclose: true,
scrollMonth: false,
scrollTime: false,
scrollInput: false,
startView: 'year',
minView:'year',
maxView:'year',
});
}
function resetTime() {
$('#time').remove();
var html = '<input type="text" class="txt range-date" id="time" name="time" placeholder="充值时间" value="" style="width: 180px;" readonly="readonly">';
$('#pay_time').html(html);
}
function detailsInfo(promote_id,create_time){
layer.open({
type: 2,
title: '结算详情',
shadeClose: true,
shade: 0.8,
area: ['80%', '70%'],
content: '/{$Think.SUBSITE_INDEX}?s=/Query/details/promote_id/'+promote_id+'/create_time/'+ create_time //iframe的url
});
}
$('#withdraw').click(function (e) {
var promoteId = parseInt($('#promote_id').val());
var settlementType = $('#settlement_type').val();
var time = $('#time').val();
var msg = '';
msg += "收益结算时间:" + time;
msg += "<br>";
if (settlementType == 3) {
msg += "补点金额:" + getAmountBySettlementType(promoteId, settlementType, time) + '元';
} else if (settlementType == 2) {
msg += "实际提现金额:" + getAmountBySettlementType(promoteId, settlementType, time) + '元';
} else {
msg += "提现金额:{$zTotal}元";
}
if (promoteId <= 0) {
layer.msg('请选择会长账号', {time: 1000});
return false;
}
if (settlementType == '') {
layer.msg('请选择提现模式', {time: 1000});
return false;
}
if (time == '') {
layer.msg('请选择充值时间', {time: 1000});
return false;
}
layer.confirm(msg, {
title: '信息',
btn: ['提交', '取消'],
}, function (index) {
layer.close(index);
layer.load(0, {shade: [0.7, '#393D49'], time: 10 * 1000}, {shadeClose: true});
$.ajax({
type: 'post',
url: '{:U("settlementWithdraw")}',
dataType: 'json',
data: {'promote_id': promoteId, 'settlement_type': settlementType, 'time': time},
success: function (data) {
layer.closeAll('loading');
if (data.status == 1) {
layer.msg(data.msg, {icon: 1});
setTimeout(function(){
window.location.reload();
},2000);
} else {
layer.msg(data.msg, {icon: 5});
}
},
error: function (result) {
layer.msg('网络异常', {icon: 5});
}
});
});
});
$('.renew-review').click(function () {
var id = parseInt($(this).attr('data-id'));
$.ajax({
type: 'post',
url: '{:U("renewReview")}',
dataType: 'json',
data: {id:id},
success: function (data) {
if (data.status == 1) {
layer.msg(data.msg, {icon: 1});
setTimeout(function(){
window.location.reload();
},2000);
} else {
layer.msg(data.msg, {icon: 5});
}
},
error: function (result) {
layer.msg('网络异常', {icon: 5});
}
});
});
$('.cancel-withdraw').click(function () {
var id = parseInt($(this).attr('data-id'));
var msg = "确定要撤销提现吗?";
layer.confirm(msg, {
title: '提示',
btn: ['确定', '取消'],
}, function (index) {
layer.close(index);
layer.load(0, {shade: [0.7, '#393D49'], time: 10 * 1000}, {shadeClose: true});
$.ajax({
type: 'post',
url: '{:U("cancelWithdraw")}',
dataType: 'json',
data: {id:id},
success: function (data) {
layer.closeAll('loading');
if (data.status == 1) {
layer.msg(data.msg, {icon: 1});
setTimeout(function(){
window.location.reload();
},2000);
} else {
layer.msg(data.msg, {icon: 5});
}
},
error: function (result) {
layer.msg('网络异常', {icon: 5});
}
});
});
});
$(".export-btn").on("click",function(e){
e.preventDefault();
window.location.href=$(this).attr("href")
});
$('#promote_id').change(function () {
var promoteId = parseInt($(this).val());
var selectTag = $('#settlement_type');
$.ajax({
type: 'post',
url: '{:U("getPromoteSettlementType")}',
dataType: 'json',
data: {promote_id:promoteId},
success: function(response) {
var options = '<option value="0">提现模式</option>'
for (var i in response.settlement_type) {
var settlementType = response.settlement_type[i]
options += '<option value="' + i + '">' + settlementType + '</option>'
}
selectTag.html(options)
}
});
});
$('#settlement_type').change(function () {
var settlementType = parseInt($(this).val());
switch (settlementType) {
case 1:
resetTime();
setTimeByWeek();
break;
case 2:
case 3:
resetTime();
setTimeByMonth();
break;
default:
break;
}
});
function getAmountBySettlementType(promoteId, settlementType, time) {
var balance = 0;
$.ajax({
type: 'post',
url: '{:U("getAmountBySettlementType")}',
dataType: 'json',
async: false,
data: {'promote_id': promoteId, 'settlement_type': settlementType, 'time': time},
success: function (data) {
balance = data.balance;
},
error: function (result) {
layer.msg('网络异常', {icon: 5});
}
});
return balance;
}
</script>
</block>