@ -30,89 +30,82 @@
< 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" >
< ul class = "tabnav1711 fr jstabnav" >
< li class = "<eq name='group' value='1'>current</eq>" > < a href = "{:U('settlement')}" > 推广结算< / a > < / li >
< li class = "<eq name='group' value='2'>current</eq>" > < a href = "{:U('settlement?group=2')}" > 结算记录< / a > < / li >
< / ul >
< 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 >
< p class = "description_text" > 说明:此功能是查看所有的会长未提现订单,并可进行后台提现 < / p >
< else / >
< p class = "description_text" > 说明:此功能是查看所有的推广员结算记录 < / p >
< p class = "description_text" > 说明:此功是查看并管理混服申请的功能 < / p >
< / if >
< / div >
< div class = "cf top_nav_list" >
< if condition = "I('group',1) eq 1" >
< div class = "infomation information1711" >
< div >
< span > 参与结算设置:< / span >
< label >
< input type = "radio" class = "inp_radio" value = "0" name = "bind_coin" < if condition = "I('bind_coin',0) eq 0" > checked="checked"< / if > > 排除绑币
< / label >
< label >
< input type = "radio" class = "inp_radio" value = "1" name = "bind_coin" < if condition = "I('bind_coin',0) eq 1" > checked="checked"< / if > > 包含绑币
< / label >
< / div >
< div style = "line-height: 30px;" >
< p > 注意①:推广结算只结算消费到游戏的所有订单记录。(系统默认全部排除绑币,可视情况自行勾选)< / p >
< p > 注意②:包含绑币勾选请慎重,由于玩家账户部分绑币的来源属于后台发放或者会长代充等,涉及到成本盈亏,是否参与推广员结算请考虑清楚!< / p >
< p > 注意③:推广结算时间请按规律时间统一结算,否则时间不统一容易导致个别游戏在统一时间内无法结算。(结算时间只可选到前一天)< / p >
< / div >
< / div >
< / if >
<!-- 高级搜索 -->
< if condition = "I('group') eq 1 or $group eq 1" >
< empty name = "model.extend" >
< div class = "fl button_list" >
< div class = "tools" >
< a class = " ajax-post " target-form = "ids" url = "{:U('generatesettlementAll?model='.$model['id'],array('ids'=>$data['id'],'bind_coin'=>I('bind_coin',0),'game_name'=>I('game_name'),'promote_account'=>I('promote_account'),'timestart'=>I('timestart'),'timeend'=>I('timeend'),'cooperation'=>I('cooperation'),'bill_number'=>I('bill_number')))}" > < span class = "button_icon button_icon14" > < / span > 批量结算< / a >
< if condition = "I('group') eq 1 or $group eq 1" >
< a id = "withdraw" > < span class = "button_icon button_icon10" > < / span > 提 现< / a >
< / if >
< / div >
< / div >
< / empty >
< / if >
< div class = "jssearch fl cf search_list" >
< div class = "input-list search-title-box" >
< label > 搜索:< / label >
< / div >
< if condition = "I('group') eq 1 or $group eq 1" >
< div class = "input-list" >
< input type = "text" id = "time-start" name = "timestart" autocomplete = "off" class = "" < if condition = "$Think.get.timestart eq '' and $Think.get.group neq 2" > value="{:get_lastweek_name(7)}" < else / > value="{:I('timestart')}" < / if > placeholder="结算周期起始时间" />
< input type = "text" id = "time-start" name = "timestart" autocomplete = "off" class = "" value = "{:I('timestart', get_lastweek_name(7))}" placeholder = "充值起始时间" / >
-
< div class = "input-append date" id = "datetimepicker" style = "display:inline-block" >
< input type = "text" id = "time-end" name = "timeend" autocomplete = "off" class = "" < if condition = "$Think.get.timeend eq '' and $Think.get.group neq 2" > value="{:get_lastweek_name(1)}" < else / > value="{:I('timeend')}" < / if > placeholder="结算周期结束时间" />
< input type = "text" id = "time-end" name = "timeend" autocomplete = "off" class = "" value = "{:I('timeend', get_lastweek_name(1))}" placeholder = "充值结束时间" / >
< span class = "add-on" > < i class = "icon-th" > < / i > < / span >
< / div >
< / 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 >
< 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_all_toppromote()" id = "vo" >
< option promote-id = "{$vo.id}" value = "{$vo.account}" > {$vo.account}< / option >
< option value = "" > 会长 账号< / option >
< volist name = ":get_ promote_list_by_id ()" id = "vo" >
< option promote-id = "{$vo.id}" value = "{$vo. id }"> {$vo.account}< / option >
< / volist >
< input type = "hidden" id = "promote_account" name = "promote_account" value = "{:I('promote_account')}" > < / input >
< / select >
< / div >
< input type = "hidden" name = "" value = "" class = "sortBy" >
< 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 layer " url = "{:U('Query/settlement?group=1','model='.$model['name'] .'&row='.I('row'),false)}" > 搜索< / a >
< 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" id = "stime-start" name = "stimestart" class = "" value = "{:I('stimestart')}" placeholder = "结算开始时间" / >
-
< div class = "input-append date" id = "sdatetimepicker" style = "display:inline-block" >
< input type = "text" id = "stime-end" name = "stimeend" class = "" value = "{:I('stimeend')}" placeholder = "结算结束时间" / >
< span class = "add-on" > < i class = "icon-th" > < / i > < / span >
< 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 >
< input type = "hidden" name = "" value = "" class = "sortBy" >
< 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 >
@ -120,8 +113,6 @@
< / div >
< / div >
<!-- 数据列表 -->
< div class = "data_list" >
< div class = "" >
@ -130,21 +121,13 @@
<!-- 表头 -->
< thead >
< tr >
< th >
< input class = "check-all" type = "checkbox" >
< / th >
< th > 结算周期< / th >
< th > 推广员账号< / th >
< th > 游戏名称< / th >
< th > < a class = "paixu" data-order = 'spay_amount' > 总充值< / a > < / th >
< th > < a class = "paixu" data-order = 'unum' > 总注册< / a > < / 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 >
< th > 结算金额< / th >
< th > 状态< / th >
<!-- <th >操作</th> -->
< / tr >
< / thead >
<!-- 列表 -->
@ -154,163 +137,29 @@
.data-table tbody td{border-right:1px solid #DDDDDD;}
.d_list .drop-down ul {z-index:999;}
< / style >
< empty name = " list_data ">
< empty name = " records ">
< td colspan = "12" class = "text-center" > aOh! 暂时还没有内容!< / td >
< else / >
< volist name = " list_data" id = "data ">
< volist name = " records" id = "record ">
< tr >
< td class = "allch" >
< input class = "ids" type = "checkbox" data-val = "{$data['id']}," value = "CPS,{$data['ratio']},{$data['money']},{$data['unum']},{$data['spay_amount']},{$data['game_id']}" name = "ids[]" >
< / td >
< td > {:I('timestart')} 至 {:I('timeend')}< / td >
< td > {:get_promote_name($data['pid'])}< / td >
< td class = "game_id" val = "{$data['game_id']}" > {:get_game_name($data['game_id'])}< / td >
< td class = "recharge cps" > {$data['spay_amount']|default=0}< / td >
< td class = "number cpa" > {$data['unum']|default=0}< / td >
< td class = "cooperation" >
< div style = "width: 110px;margin: 0 auto;" >
< div class = "d_list" >
< div class = "drop-down limitwidth3 cooperwrap" >
< span class = "sort-txt" data = "CPS" >
< span class = "cooperation_mode" > CPS< / span >
< / span >
< i class = "arrow arrow-down" > < / i >
< ul class = "nav-list hidden" >
< li > < a href = "javascript:;" value = "CPS" > < span class = "cooperation_mode" > CPS< / span > < / a > < / li >
< li > < a href = "javascript:;" value = "CPA" > < span class = "cooperation_mode no" > CPA< / span > < / a > < / li >
< / ul >
< / div >
< / div >
< / div >
< / td >
< td class = "ratio cp" >
< span > < notempty name = "data.ratio" > {$data.ratio}< else / > 0< / notempty > < / span > %
< a href = "javascript:;" id = "ratiobtn" data-coom = "CPS" data-notice = "请输入1-100的数字,如:30即为30%" class = "cpbtn" > 修改< / a >
< / td >
< td class = "price cp" >
< span > < notempty name = "data.money" > {$data.money}< else / > 0< / notempty > < / span >
< a href = "javascript:;" id = "ratiobtn" data-coom = "CPA" data-notice = "请输入数字" class = "cpbtn" > 修改< / a >
< / 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" >
{:round($data['spay_amount'] * $data['ratio']/100,2) }
{$record['settlement_amount']}
< / td >
< if condition = "get_settlement(I('timestart'),I('timeend'),$data['pid'],$data['game_id']) eq true" >
< td > 已结算< / td >
< else / >
< td > 可结算< / td >
< / if >
< / tr >
< / volist >
< tr class = "data_summary" >
< td > 汇总< / td >
< td colspan = "10" > 当页结算:{$total}元 ; 今日结算:{$tTotal}元 ; 昨日结算:{$yTotal}元 ; 累计结算:{$zTotal}元< / td >
< / tr >
< / empty >
< / tbody >
< / table >
< script >
function pop(text,classname) {
classname = classname?classname:'';
updateAlert(text,classname);
setTimeout(function(){
//$('#top-alert').find('button').click();
$('#tip').find('.tipclose').click();
},1500);
}
$('.cooperwrap').hover(function(){
$(this).find('.nav-list').removeClass('hidden');
},function(){
$(this).find('.nav-list').addClass('hidden');
});
$('.cooperwrap .nav-list li').find('a').each(function(){
var that = $(this).closest('.cooperwrap'),top = $(this).closest('.cooperation');
$(this).click(function(){
var text = $(this).text(),val=$(this).attr('value');
that.find('.sort-txt').text(text).attr('data',val);
that.find('.nav-list').addClass('hidden');
var ratio = top.siblings('.ratio').find('span').text(),
price = top.siblings('.price').find('span').text(),
unum = top.siblings('.cpa').text(),
spay_amount = top.siblings('.cps').text(),
game_id = top.siblings('.game_id').attr('val'),
ids = top.siblings('.allch').find('.ids'),money=0;
val = text+','+ratio+','+price+','+unum+','+spay_amount+','+game_id+',';
ids.attr('value',val);
if (text == 'CPS') {
money = Math.round(ratio * top.siblings('.recharge').text())/100;
} else {
money = price * top.siblings('.number').text();
}
;
if (isNaN(money)) {money=0;}
top.siblings('.money').text(money);
})
});
$('.cpbtn').on('click',function() {
var that = this,placeholder = $(that).data('notice'),cp = $.trim($(that).data('coom'));
html = '< div class = "noticemsg " > ';
html += '< div class = "noticemain" > < div class = "noticeinput" > < input placeholder = "'+placeholder+'" type = "text" class = "txt" > < / div > '
html += '< div class = "noticebtn cpn" > < a href = "javascript:;" > 确定< / a > < / div > < / div > < / div > ';
$('body').append(html);
$('.noticebtn a').on('click',function() {
var val = $.trim($('.noticeinput input').val()),closeste = $(that).closest('.cp');
if (val) {
if (!/^\d+(\.\d{2})?$/.test(val)) {pop('请输入正确的数字');return false;}
$(that).siblings('span').text(val);
var money = closeste.siblings('.money').text(),
cooperation = $.trim(closeste.siblings('.cooperation').find('.sort-txt').text());
if (cooperation === cp) {
money = val * closeste.siblings('.'+(cp.toLowerCase())).text();
}
switch(cp){
case 'CPS':
if (cooperation === cp) {
money = Math.round(money)/100;
}
ratio = val;
price = closeste.siblings('.price').find('span').text();
break;
case 'CPA':
price = val;
ratio = closeste.siblings('.ratio').find('span').text();
break;
}
if (isNaN(money)) {money=0;}
closeste.siblings('.money').text(money);
ids = closeste.siblings('.allch').find('.ids');
unum = closeste.siblings('.cpa').text();
spay_amount = closeste.siblings('.cps').text();
game_id = closeste.siblings('.game_id').attr('val');
val = cooperation+','+ratio+','+price+','+unum+','+spay_amount+','+game_id+',';
ids.attr('value',val);
}
$(this).closest('.noticemsg').remove();
});
$('.noticeinput input').keyup(function(event) {
if (event.keyCode == 13) {
$('.noticebtn a').click();
}
});
});
$('.confirmbtn').on('click',function() {
var that = $(this),closeste = that.closest('.op'),
cooperation = $.trim(closeste.siblings('.cooperation').find('.sort-txt').text()),
ratio = closeste.siblings('.ratio').find('span').text(),
price = closeste.siblings('.price').find('span').text(),
url = $(this).data('val'),index = url.lastIndexOf('.html');
if (index > 0)
url = url.substring(0,index)+'/cooperation/'+cooperation+'/cps_ratio/'+ratio+'/cpa_price/'+price+'.html';
else
url = url+'/cooperation/'+cooperation+'/cps_ratio/'+ratio+'/cpa_price/'+price+'.html';
$(this).siblings('.settlementbtn').attr('url',url).click();
});
< / script >
< / if >
< if condition = "$group eq 2" >
< table >
@ -318,47 +167,64 @@
< 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 >
< th > 结算截止时间< / th >
< th > 提现时间< / th >
< th > 提现状态< / th >
< th > 说明< / th >
< th > 操作< / th >
< / tr >
< / thead >
<!-- 列表 -->
< tbody >
< volist name = "list_data" id = "data" >
< volist name = " records" id = "record ">
< tr >
< td > {$record.promote_account}< / td >
< td > {$record.widthdraw_number}< / td >
< td > {$record.sum_money}< / td >
< td >
< if condition = "$is_admin eq true " >
{:get_promote_name($data['promote_id'])}
< else / >
{:encryptStr(get_promote_name($data['promote_id']))}
< if condition = "$record.op_type eq 1" >
{:get_promote_name($record['op_id'])}
< elseif condition = "$record.op_type eq 2" / >
{:getAdminNickname($record['op_id'])}
< else / >
自动
< / if >
< / td >
< td > {$data.starttime|date='Y-m-d',###}至{$data.endtime|date='Y-m-d',###}< / td >
< td > {$data.settlement_number}< / td >
< td > {$data.total_money}< / td >
< td > {$data.total_number}< / td >
< td >
< span class = "money_color" > {$data.sum_money}< / span >
< / td >
< td > {:get_bind_coin_status($data['bind_coin_status'])}< / td >
< td > {:getPromoteWithdrawOpType($record['op_type'])}< / td >
< td >
{$data.create_time|date='Y-m-d',###}
< if condition = "$record.last_op_type eq 1" >
{:get_promote_name($record['last_op_id'])}
< elseif condition = "$record.last_op_type eq 2" / >
{:getAdminNickname($record['last_op_id'])}
< else / >
自动
< / if >
< / td >
< td > {:getPromoteWithdrawOpType($record['last_op_type'])}< / 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 >
< a href = "javascript:" onclick = "detailsInfo({$data['promote_id']},{$data['create_time']})" > 查看< / a >
< if condition = "$record['status'] eq 2" >
< a href = "{:U('downloadProve', ['id'=>$record['id']])}" > 汇款证明< / a >
< elseif 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 >
< tr class = "data_summary" >
< td > 汇总< / td >
< td colspan = "10" > 当页结算:{$total}元 ; 今日结算:{$ttotal}元 ; 昨日结算:{$ytotal}元 ; 累计结算:{$ztotal}元< / td >
< / tr >
< / tbody >
< / table >
< / if >
@ -369,7 +235,7 @@
< if condition = "I('group') eq 2 or $group eq 2" >
< a class = "sch-btn" href = "{:U('Export/expUser',array(
'id'=>15,
'promote_account'=>I('promote_account '),
'promote_id'=>I('promote_id '),
'timestart'=>I('timestart'),
'timeend'=>I('timeend'),
'start'=>I('start'),
@ -403,71 +269,30 @@
< 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 >
< script type = "text/javascript" >
< script >
< volist name = ":I('get.')" id = "vo" >
Think.setValue('{$key}', "{$vo}");
< / volist >
$(".select_gallery").select2();
$(".input-list-promote").click(function(){
$('#select2-promote_id-container').text('推广员账号');
$("#promote_account").val('');
$("#promote_accountt").val('');
});
$("#promote_id").change(function() {
$("#promote_account").val($("#promote_id option:selected").val());
$("#promote_accountt").val($("#promote_id option:selected").attr('promote-id'));
});
$(".input-list-game").click(function(){
$('#select2-game_id-container').text('请选择游戏');
$("#game_name").val('');
$("#game_namee").val('');
});
$("#game_id").change(function() {
$("#game_name").val($("#game_id option:selected").val());
$("#game_namee").val($("#game_id option:selected").attr('game-id'));
});
< / script >
< script type = "text/javascript" >
< / script >
< script type = "text/javascript" >
//导航高亮
highlight_subnav("{:U('Query/settlement')}");
if('{$Think.get.game_name}'!=''){
$('#select2-game_id-container').text('{$Think.get.game_name}');
}
if('{$Think.get.promote_account}'!=''){
$('#select2-promote_id-container').text('{$Think.get.promote_account}');
}
Think.setValue('row','{:I("row",10)}');
$(function(){
$("#searchlayer").click(function(){
var url = $(this).attr('url');
that=$('.top_nav_list');//jssearch
var query = that.find('input').serialize();
if(that.find('#promote_account').val()==''){
layer.msg('请选择推广员',
{time: 1000,
});exit;
};
starttime=that.find('#time-start').val();
endtime=that.find('#time-end').val();
checkEndTime(starttime,endtime);
query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
query = query.replace(/^&/g,'');
if( url.indexOf('?')>0 ){
url += '& ' + query;
}else{
url += '?' + query;
}
window.location.href = url;
});
//搜索功能
$("#search").click(function(){
var starttime = $.trim($('#time-start').val());
var endtime = $.trim($('#time-end').val());
if((starttime & & !endtime) || (!starttime & & endtime)) {layer.msg('请完整选择结算周期时间');return false;}
if (starttime & & endtime & & starttime > endtime) {layer.msg('开始时间必须小于等于结束时间');return false;}
var url = $(this).attr('url');
var query = $('.top_nav_list').find('input').serialize();
var promoteId = $('#promote_id').val();
var group = parseInt("{$group}");
if (promoteId == '' & & group === 1) {
layer.msg('请选择推广员', {time: 1000});
return false;
}
query += "&"+$('.top_nav_list').find('select').serialize();
query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
query = query.replace(/^&/g,'');
@ -476,74 +301,35 @@
}else{
url += '?' + query;
}
var start = $("#stime-start").val();
var end = $("#stime-end").val();
if (start !='' & & end != ''){
if (Date.parse(start) > Date.parse(end)){
layer.msg('开始时间必须小于等于结束时间');
return false;
}
}
window.location.href = url;
});
function checkEndTime(startTime,endTime){
if(startTime==''){
layer.msg('请选择起始时间',
{time: 1000,
});;exit;
}
if(endTime==''){
layer.msg('请选择结束时间',
{time: 1000,
});;exit;
}
var start=new Date(startTime.replace("-", "/").replace("-", "/"));
var end=new Date(endTime.replace("-", "/").replace("-", "/"));
if(end< start ) {
layer.msg('结束时间要小于起始时间',
{time: 1000,
});;exit;
}
}
$(".paixu").click(function(){
var that=$(this);
$data_order=that.attr('data-order');
$order_type='{$userarpu_order}';
if($order_type==''||$order_type=='4'){
$(".sortBy").attr('name','data_order');
val='3,'+$data_order;
$(".sortBy").attr('value',val);
$("#searchlayer").click();
}else if($order_type=='3'){
$(".sortBy").attr('name','data_order');
val='4,'+$data_order;
$(".sortBy").attr('value',val);
$("#searchlayer").click();
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){
$("#searchlayer").click();
}
});
//点击排序
$('.list_sort').click(function(){
var url = $(this).attr('url');
var ids = $('.ids:checked');
var param = '';
if(ids.length > 0){
var str = new Array();
ids.each(function(){
str.push($(this).val());
});
param = str.join(',');
}
if(url != undefined & & url != ''){
window.location.href = url.replace(".html","") + '/ids/' + param;
$("#search").click();
}
});
var date="{$setdate}";
@ -569,7 +355,7 @@
scrollInput:false,
endDate:date
})
$('#stime-start ').datetimepicker({
$('#create_time ').datetimepicker({
format: 'yyyy-mm-dd',
language:"zh-CN",
minView:2,
@ -579,87 +365,120 @@
scrollInput:false,
endDate:date
});
$('#sdatetimepicker').datetimepicker({
format: 'yyyy-mm-dd',
language:"zh-CN",
minView:2,
autoclose:true,
scrollMonth:false,
scrollTime:false,
scrollInput:false,
pickerPosition:'bottom-left',
endDate:date
})
$('#game').on('click',function(event) {
var navlist = $(this).find('.nav-list');
if (navlist.hasClass('hidden')) {
navlist.removeClass('hidden');
$(this).find('.sort-txt').focus().val('');
function detailsInfo(promote_id,create_time){
layer.open({
type: 2,
title: '结算详情',
shadeClose: true,
shade: 0.8,
area: ['80%', '70%'],
content: '/admin.php?s=/Query/details/promote_id/'+promote_id+'/create_time/'+ create_time //iframe的url
});
}
$('#withdraw').click(function (e) {
var beginTime = $('#time-start').val();
var endTime = $('#time-end').val();
var promoteId = parseInt($('#promote_id').val());
var balance = parseFloat("{$zTotal}");
var msg = "收益结算时间:" + $('#time-start').val() + " 至 " + $('#time-end').val();
msg += "< br > ";
msg += "提现金额:{$zTotal}元";
if (Date.parse(beginTime) / 1000 > Date.parse(endTime) / 1000) {
layer.msg('开始时间必须小于等于结束时间');
return false;
}
if (promoteId < = 0) {
layer.msg('请选择会长账号');
return false;
}
if (balance < 100 ) {
layer.msg('累计结算低于100元, 无法提现! ', {icon: 5});
return false;
}
layer.confirm(msg, {
title: '信息',
btn: ['提交', '取消'],
}, function (index) {
layer.close(index);
layer.load(0, {shade: [0.7, '#393D49']}, {shadeClose: true});
$.ajax({
type: 'post',
url: '{:U("settlementWithdraw")}',
dataType: 'json',
data: {'begin_time': beginTime, 'end_time': endTime, 'promote_id': promoteId},
success: function (data) {
if (data.status == 1) {
layer.msg(data.msg, {icon: 1});
setTimeout(function(){
window.location.reload();
},2000);
} else {
navlist.addClass('hidden');
layer.msg(data.msg, {icon: 5});
}
},
error: function (result) {
layer.msg('网络异常', {icon: 5});
}
$(document).one('click', function(){
navlist.addClass('hidden');
});
event.stopPropagation();
});
$('#game .sort-txt').on('keyup',function(event) {
var val = $.trim($(this).val()).toLowerCase();
$('#game').siblings('input').val(val);
});
$('#game .nav-list').find("a").each(function(){
var that = $('#game');
$(this).click(function(){
var text = $.trim($(this).text()).toLowerCase();
that.find('.sort-txt').val(text);
that.siblings('input').val(text);
})
});
$('#promote').on('click',function(event) {
var navlist = $(this).find('.nav-list');
if (navlist.hasClass('hidden')) {
navlist.removeClass('hidden');
$(this).find('.sort-txt').focus().val('');
$('.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 {
navlist.addClass('hidden');
layer.msg(data.msg, {icon: 5});
}
},
error: function (result) {
layer.msg('网络异常', {icon: 5});
}
$(document).one('click', function(){
navlist.addClass('hidden');
});
event.stopPropagation();
});
$('#promote .sort-txt').on('keyup',function(event) {
var val = $.trim($(this).val()).toLowerCase();
$('#promote').siblings('input').val(val);
$('.cancel-withdraw').click(function () {
var id = parseInt($(this).attr('data-id'));
var msg = "确定要撤销提现吗?";
layer.confirm(msg, {
title: '提示',
btn: ['确定', '取消'],
}, function () {
$.ajax({
type: 'post',
url: '{:U("cancelWithdraw")}',
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});
}
});
$('#promote .nav-list').find("a").each(function(){
var that = $('#promote');
$(this).click(function(){
var text = $.trim($(this).text()).toLowerCase();
that.find('.sort-txt').val(text);
that.siblings('input').val(text);
})
});
})
function detailsInfo(promote_id,create_time){
layer.open({
type: 2,
title: '结算详情',
shadeClose: true,
shade: 0.8,
area: ['80%', '70%'],
content: '/admin.php?s=/Query/details/promote_id/'+promote_id+'/create_time/'+ create_time //iframe的url
});
}
< / script >
< / block >