1.28功能提交

master
zhengyongxing 4 years ago
parent b7c671ef1c
commit deff984922

@ -1,6 +1,7 @@
<?php
namespace Admin\Controller;
//use Think\Controller;
/**
* 上下游结算单
* @author cz
@ -309,11 +310,11 @@ class CompanyStatementPoolController extends ThinkController
$infolist = SM("company_statement_info","tab_")->field("*,'1' as st")->where("pool_id = '{$id}' and pay_status!=1")->select();
//获取母单
$pool_info = SM("company_statement_pool","tab_")->field('statement_num,create_lack_ids,verify_status,is_payment,withdraw_type,statement_begin_time,statement_end_time')->where("id={$id}")->find();
if(!empty($pool_info['create_lack_ids'])){
$l_ids = $pool_info['create_lack_ids'];
$lack_info = SM("company_lack_statement_info","tab_")->field("*,'0' as st")->where("id in ({$l_ids})")->select();
$infolist =array_merge($infolist,$lack_info);
}
// if(!empty($pool_info['create_lack_ids'])){
// $l_ids = $pool_info['create_lack_ids'];
// $lack_info = SM("company_lack_statement_info","tab_")->field("*,'0' as st")->where("id in ({$l_ids})")->select();
// $infolist =array_merge($infolist,$lack_info);
// }
// dump($infolist);die();
@ -346,7 +347,7 @@ class CompanyStatementPoolController extends ThinkController
//获取基本信息
$infolist = SM("company_statement_info","tab_")->field("*,'1' as st")->where("pool_id = '{$id}'")->select();
//获取母单
$pool_info = SM("company_statement_pool","tab_")->field('statement_num,create_lack_ids,verify_status,is_payment,withdraw_type')->where("id={$id}")->find();
$pool_info = SM("company_statement_pool","tab_")->field('statement_num,create_lack_ids,verify_status,is_payment,withdraw_type,company_type')->where("id={$id}")->find();
if(!empty($pool_info['create_lack_ids'])){
$l_ids = $pool_info['create_lack_ids'];
$lack_info = SM("company_lack_statement_info","tab_")->field("*,'0' as st")->where("id in ({$l_ids})")->select();
@ -354,6 +355,7 @@ class CompanyStatementPoolController extends ThinkController
}
$statement_num = $pool_info['statement_num'];
$this->assign("withdraw_type",$pool_info['withdraw_type']);
$this->assign("title",$statement_num);
$this->assign("pool_status",$pool_info['verify_status']);
$this->assign("is_payment",$pool_info['is_payment']);
@ -362,8 +364,10 @@ class CompanyStatementPoolController extends ThinkController
} else {
if($pool_info['company_type'] == 2) {
$this->editPuPool($infolist,$is_export);
} else {
} elseif($pool_info['company_type'] == 1) {
$this->editPcPool($infolist, $is_export);
} elseif($pool_info['company_type'] == 3) {
$this->editCpPool($infolist, $is_export);
}
}
@ -499,13 +503,13 @@ class CompanyStatementPoolController extends ThinkController
}
}else{
if ($v['withdraw_type'] != 3) {
$va['d_statement_money'] = round($va['pay_amount']*($va['ratio']+$va['increment_ratio'])*(100-$va['fax_ratio'])/100/100,2);
$va['d_statement_money'] = round(($va['pay_amount']-$va['refund'])*($va['ratio']+$va['increment_ratio'])*(100-$va['fax_ratio'])/100/100,2);
$count['platform_amount'] += $va['pay_amount'];
$count['d_statement_money'] += $va['d_statement_money'];
} else {
$va['d_statement_money'] = round(($va['pay_amount']*($va['increment_ratio']))/100,2);
$va['d_statement_money'] = round((($va['pay_amount']-$va['refund'])*($va['increment_ratio']))/100,2);
$count['platform_amount'] += $va['pay_amount'];
@ -548,6 +552,88 @@ class CompanyStatementPoolController extends ThinkController
}
//上游汇总查看及导出
public function editCpPool(&$infolist,$is_export)
{
$line = 2;
$count = [];
//获取平台名
$p_id = array_column($infolist,'company_id');
$map['id'] = ['in',$p_id];
$pl = M("Partner","tab_")->field("id,matche_platform")->where($map)->select();
$Partner = [];
foreach($pl as $k=>$v){
$Partner[$v['id']] = $v['matche_platform'];
}
unset($pl);
//
foreach($infolist as $k=>&$v){
$v['statement_info'] = json_decode($v['statement_info'],true);
$v['company_info'] = json_decode($v['company_info'],true);
$v['statement_begin_time'] = date('Y.m.d',$v['statement_begin_time']);
$v['statement_end_time'] = date('Y.m.d',$v['statement_end_time']);
if( isset($v['verify_status'])){
if( $v['verify_status'] ==2 ){
$v['is_payment'] = 2; //不打款
}else{
$v['is_payment'] = 1;
}
}
$cline = $line+1;
$handle_data = $this->changeDataStructCp($v['statement_info'],$is_export,$cline);
$v['statement_info'] = $handle_data;
foreach($v['statement_info'] as $ke=>&$va){
// dd($va);
$line ++;
$va['company_ratio'] = 100-$va['ratio'];
if($is_export){
$va['d_statement_money'] = "=ROUND(F{$line}*(1-I{$line})*G{$line}*(1-J{$line}),2)";//=ROUND(F3*(1-I3)*G3*(1-J3),2)
}else{
$va['d_statement_money'] = round(($va['pay_amount']-$va['refund'])*(100-$va['promote_ratio'])*$va['ratio']*(100-$va['fax_ratio'])/1000000,2);
$count['platform_amount'] += $va['pay_amount'];
$count['platform_amount2'] += $va['pay_amount'];
$count['d_statement_money'] += $va['d_statement_money'];
}
}
// $handle_data = $this->changeDataStructVc($v['statement_info'],$is_export,$cline);
// $v['statement_info'] = $handle_data;
// dump($v['statement_info']);
$v['matche_platform'] = $Partner[$v['company_id']];
if($is_export){
$v['statement_money'] = "=ROUND(SUM(K{$cline}:K{$line})+M{$cline}-L{$cline},2)";
}else{
$count['fine'] += $v['fine'];
$count['reward'] += $v['reward'];
$count['statement_money'] += $v['statement_money'];
$count['statement_money_s'] += $v['statement_money'];
}
$v['statement_count'] = count($v['statement_info']);
}
if($is_export){
$count["d_statement_money"] = "=ROUND(SUM(K3:K".$line."),2)";
$count["platform_amount"] = "=ROUND(SUM(E3:E".$line."),2)";
$count["platform_amount2"] = "=ROUND(SUM(F3:F".$line."),2)";
$count["fine"] = "=ROUND(SUM(L3:L".$line."),2)";
$count["reward"] = "=ROUND(SUM(M3:M".$line."),2)";
$count["statement_money"] = "=ROUND(SUM(N3:N".$line."),2)";
$count["statement_money_s"] = "=ROUND(SUM(N3:N".$line."),2)";
}
// dd($infolist);
$this->assign("data",$infolist);
$this->assign("count",$count);
$this->assign("is_export",$is_export);
$this->display("CompanyStatementPool/editCpPool");
}
public function editSpecialPuPool(&$infolist,$is_export) {
$line = 1;
$count = [];
@ -859,7 +945,7 @@ class CompanyStatementPoolController extends ThinkController
$game_data['week_amount'] = 0;
//周结算金额计算
for ($i=0;;$i++) {
if ($sv[$i]['sum_money']) {
if ($sv[$i]['sum_money']||$sv[$i]['sum_money']=='0') {
$game_data['week_amount'] += $sv[$i]['sum_money']- $sv[$i]['withhold']+$sv[$i]['reward']-$sv[$i]['fine'];
$game_data['withhold_amount'] += $sv[$i]['withhold'];
$game_data['fine'] += $sv[$i]['fine'];
@ -965,6 +1051,228 @@ class CompanyStatementPoolController extends ThinkController
return $handle_data?$handle_data:[];
}
public function changeDataStructVc($statement_info,$is_export = 0,$cline) {
$game_list = [];
$nline = $cline;
//使用时间与会长账号作为键值分离数据
foreach($statement_info as $sk=>$sv){
$sv['time'] = $sv['statement_begin_time'].'-'.$sv['statement_end_time'];
$game_list[$sv['statement_begin_time'].'-'.$sv['statement_end_time']][] = $sv;
}
$handle_data = [];
$substract = 1;
//处理游戏金额数据
foreach($game_list as $gk => $gv) {
foreach ($gv as $lk => $lv){
if ($lk > 0) {
for (;;) {
if (!$handle_data[$lk-$substract]['time']) {
// $nline++;
$substract++;
} else {
$handle_data[$lk-$substract]['row'] += 1;
$handle_data[$lk-$substract]['week_amount'] += $lv['sum_money'] - $lv['withhold'] + $lv['reward'] - $lv['fine'];
// if ($is_export) {
// $handle_data[$lk-$substract]['week_amount'] = "=ROUND(SUM(I{$cline}:I{$nline}),2)";
// }
unset($lv['time']);
break;
}
}
} else {
$lv['row'] = 1;
$lv['week_amount'] = $lv['sum_money'] - $lv['withhold'] + $lv['reward'] - $lv['fine'];
// $nline++;
// if ($is_export) {
// $lv['week_amount'] = "=ROUND(SUM(I{$cline}:I{$nline}),2)";
// }
}
array_push($handle_data,$lv);
}
}
foreach($handle_data as $hk => $hv) {
$substract = 1;
if ($is_export) {
// dump($hv);
for (;;) {
if (!$handle_data[$hk+$substract]['time']&&$handle_data[$hk+$substract]&&$hv['time']) {
// dump($handle_data[$hk+$substract]);
$cline++;
$substract++;
} else {
break;
}
}
// if (count($handle_data)>1) {
// $cline += count($handle_data)-1;
// }
if ($hv['time']&&$hk!=0) {
$nline =+ $cline+1;
$cline = $nline;
}
$handle_data[$hk]['week_amount'] = "=ROUND(SUM(J{$nline}:J{$cline})-SUM(K{$nline}:K{$cline})+SUM(L{$nline}:L{$cline})-SUM(M{$nline}:M{$cline}),2)";
// if ($hk > 0) {
// $handle_data[0]['week_amount'] = str_replace($nline,$cline,$handle_data[0]['week_amount']);
// }
// if (count($handle_data)>1) {
//
// $nline += count($handle_data);
//
// } else {
// $nline++;
// }
//
// if(count($handle_data)>1) {
//
// $cline = $nline ;
// } else {
// $cline = $nline;
// }
}
}
// die();
return $handle_data;
}
public function changeDataStructCp($statement_info,$is_export = 0,$cline) {
$game_list = [];
$nline = $cline;
//使用时间与会长账号作为键值分离数据
foreach($statement_info as $sk=>$sv){
$sv['time'] = $sv['statement_begin_time'].'-'.$sv['statement_end_time'];
$game_list[$sv['statement_begin_time'].'-'.$sv['statement_end_time']][] = $sv;
}
$handle_data = [];
$substract = 1;
//处理游戏金额数据
foreach($game_list as $gk => $gv) {
foreach ($gv as $lk => $lv){
if ($lk > 0) {
for (;;) {
if (!$handle_data[$lk-$substract]['time']) {
// $nline++;
$substract++;
} else {
$handle_data[$lk-$substract]['row'] += 1;
$handle_data[$lk-$substract]['week_amount'] += $lv['sum_money'] - $lv['withhold'] + $lv['reward'] - $lv['fine'];
// if ($is_export) {
// $handle_data[$lk-$substract]['week_amount'] = "=ROUND(SUM(I{$cline}:I{$nline}),2)";
// }
unset($lv['time']);
break;
}
}
} else {
$lv['row'] = 1;
$lv['week_amount'] = $lv['sum_money'] - $lv['withhold'] + $lv['reward'] - $lv['fine'];
// $nline++;
// if ($is_export) {
// $lv['week_amount'] = "=ROUND(SUM(I{$cline}:I{$nline}),2)";
// }
}
array_push($handle_data,$lv);
}
}
foreach($handle_data as $hk => $hv) {
$substract = 1;
if ($is_export) {
// dump($hv);
for (;;) {
if (!$handle_data[$hk+$substract]['time']&&$handle_data[$hk+$substract]&&$hv['time']) {
// dump($handle_data[$hk+$substract]);
$cline++;
$substract++;
} else {
break;
}
}
// if (count($handle_data)>1) {
// $cline += count($handle_data)-1;
// }
if ($hv['time']&&$hk!=0) {
$nline =+ $cline+1;
$cline = $nline;
}
$handle_data[$hk]['week_amount'] = "=ROUND(SUM(L{$nline}:L{$cline})-SUM(M{$nline}:M{$cline})+SUM(N{$nline}:N{$cline})-SUM(O{$nline}:O{$cline}),2)";
// if ($hk > 0) {
// $handle_data[0]['week_amount'] = str_replace($nline,$cline,$handle_data[0]['week_amount']);
// }
// if (count($handle_data)>1) {
//
// $nline += count($handle_data);
//
// } else {
// $nline++;
// }
//
// if(count($handle_data)>1) {
//
// $cline = $nline ;
// } else {
// $cline = $nline;
// }
}
}
// die();
return $handle_data;
}
//下游汇总结算查看
public function viewPcPool(&$infolist,$is_export){
@ -995,6 +1303,10 @@ class CompanyStatementPoolController extends ThinkController
}
}
$cline = $line+1;
$handle_data = $this->changeDataStructVc($v['statement_info'],$is_export,$cline);
$v['statement_info'] = $handle_data;
foreach($v['statement_info'] as $ke=>&$va){
$line ++;
@ -1013,19 +1325,19 @@ class CompanyStatementPoolController extends ThinkController
// $va['d_statement_money'] = "=ROUND(E{$line}*(G{$line}),2)";
// }
if($v['withdraw_type'] != 3) {
$va['d_statement_money'] = "=ROUND(D{$line}*(1-G{$line})*(E{$line}+F{$line}),2)";
$va['d_statement_money'] = "=ROUND((E{$line}-F{$line})*(1-I{$line})*(H{$line}+G{$line}),2)";
} else {
$va['d_statement_money'] = "=ROUND(D{$line}*(F{$line}),2)";
$va['d_statement_money'] = "=ROUND((E{$line}-F{$line})*(1-I{$line})*(H{$line}),2)";
}
}else{
if ($v['withdraw_type'] != 3) {
$va['d_statement_money'] = round($va['pay_amount']*($va['ratio']+$va['increment_ratio'])*(100-$va['fax_ratio'])/100/100,2);
$va['d_statement_money'] = round(($va['pay_amount']-$va['refund'])*($va['ratio']+$va['increment_ratio'])*(100-$va['fax_ratio'])/100/100,2);
$count['platform_amount'] += $va['pay_amount'];
$count['d_statement_money'] += $va['d_statement_money'];
} else {
$va['d_statement_money'] = round(($va['pay_amount']*($va['increment_ratio']))/100,2);
$va['d_statement_money'] = round((($va['pay_amount']-$va['refund'])*($va['increment_ratio']))/100,2);
$count['platform_amount'] += $va['pay_amount'];
@ -1040,13 +1352,15 @@ class CompanyStatementPoolController extends ThinkController
if ($v['withdraw_type'] != 3) {
// $v['statement_money'] = "=ROUND(SUM(I{$cline}:I{$line})+K{$cline}-J{$cline},2)";
$v['statement_money'] = "=ROUND(SUM(H{$cline}:H{$line})+J{$cline}-I{$cline},2)";
// $v['statement_money'] = "=ROUND(SUM(H{$cline}:H{$line})+J{$cline}-I{$cline},2)";
$v['statement_money'] = "=ROUND(SUM(N{$cline}:N{$line}),2)";
}
}else{
$count['fine'] += $v['fine'];
$count['reward'] += $v['reward'];
$count['statement_money'] += $v['statement_money'];
$count["statement_money_s"] += $v['statement_money'];
}
$v['statement_count'] = count($v['statement_info']);
if($v['statement_count'] == '0'){
@ -1055,11 +1369,12 @@ class CompanyStatementPoolController extends ThinkController
}
if($is_export){
$count["platform_amount"] = "=ROUND(SUM(D2:D".$line."),2)";
$count["d_statement_money"] = "=ROUND(SUM(H2:H".$line."),2)";
$count["fine"] = "=ROUND(SUM(I2:I".$line."),2)";
$count["reward"] = "=ROUND(SUM(J2:J".$line."),2)";
$count["statement_money"] = "=ROUND(SUM(K2:K".$line."),2)";
$count["platform_amount"] = "=ROUND(SUM(E2:E".$line."),2)";
$count["d_statement_money"] = "=ROUND(SUM(J2:J".$line."),2)";
$count["fine"] = "=ROUND(SUM(K2:K".$line."),2)";
$count["reward"] = "=ROUND(SUM(L2:L".$line."),2)";
$count["statement_money"] = "=ROUND(SUM(N2:N".$line."),2)";
$count["statement_money_s"] = "=ROUND(SUM(O2:O".$line."),2)";
}
// dd($infolist);
$this->assign("data",$infolist);
@ -1069,66 +1384,6 @@ class CompanyStatementPoolController extends ThinkController
}
public function changeDataStructVc($statement_info,$is_export = 0,$cline) {
$game_list = [];
$nline = $cline;
//使用时间与会长账号作为键值分离数据
foreach($statement_info as $sk=>$sv){
$sv['time'] = $sv['statement_begin_time'].'-'.$sv['statement_end_time'];
$game_list[$sv['statement_begin_time'].'-'.$sv['statement_end_time']][] = $sv;
}
$handle_data = [];
$substract = 1;
//处理游戏金额数据
foreach($game_list as $gk => $gv) {
foreach ($gv as $lk => $lv){
if ($lk > 0) {
for (;;) {
if (!$handle_data[$lk-$substract]['time']) {
$nline++;
$substract++;
} else {
$handle_data[$lk-$substract]['row'] += 1;
$handle_data[$lk-$substract]['week_amount'] += $lv['sum_money'];
if ($is_export) {
$handle_data[$lk-$substract]['week_amount'] = "=ROUND(SUM(I{$cline}:I{$nline}),2)";
}
unset($lv['time']);
break;
}
}
} else {
$lv['row'] = 1;
$lv['week_amount'] = $lv['sum_money'];
$nline++;
if ($is_export) {
$lv['week_amount'] = "=ROUND(SUM(I{$cline}}:I{$nline}),2)";
}
}
array_push($handle_data,$lv);
}
}
return $handle_data;
}
//上游汇总查看及导出
public function viewCpPool(&$infolist,$is_export)
{
@ -1158,18 +1413,20 @@ class CompanyStatementPoolController extends ThinkController
}
}
// dump($v['statement_info']);
$cline = $line+1;
$handle_data = $this->changeDataStructCp($v['statement_info'],$is_export,$cline);
$v['statement_info'] = $handle_data;
foreach($v['statement_info'] as $ke=>&$va){
// dd($va);
$line ++;
$va['company_ratio'] = 100-$va['ratio'];
if($is_export){
$va['d_statement_money'] = "=ROUND(F{$line}*(1-I{$line})*G{$line}*(1-J{$line}),2)";//=ROUND(F3*(1-I3)*G3*(1-J3),2)
$va['d_statement_money'] = "=ROUND((F{$line}-G{$line})*(1-J{$line})*H{$line}*(1-K{$line}),2)";//=ROUND(F3*(1-I3)*G3*(1-J3),2)
}else{
$va['d_statement_money'] = round($va['pay_amount']*(100-$va['promote_ratio'])*$va['ratio']*(100-$va['fax_ratio'])/1000000,2);
$va['d_statement_money'] = round(($va['pay_amount']-$va['refund'])*(100-$va['promote_ratio'])*$va['ratio']*(100-$va['fax_ratio'])/1000000,2);
$count['platform_amount'] += $va['pay_amount'];
$count['platform_amount2'] += $va['pay_amount'];
@ -1183,22 +1440,25 @@ class CompanyStatementPoolController extends ThinkController
$v['matche_platform'] = $Partner[$v['company_id']];
if($is_export){
$v['statement_money'] = "=ROUND(SUM(K{$cline}:K{$line})+M{$cline}-L{$cline},2)";
// $v['statement_money'] = "=ROUND(SUM(K{$cline}:K{$line})+M{$cline}-L{$cline},2)";
$v['statement_money'] = "=ROUND(SUM(P{$cline}:P{$line}),2)";
}else{
$count['fine'] += $v['fine'];
$count['reward'] += $v['reward'];
$count['statement_money'] += $v['statement_money'];
$count['statement_money_s'] += $v['statement_money'];
}
$v['statement_count'] = count($v['statement_info']);
}
if($is_export){
$count["d_statement_money"] = "=ROUND(SUM(K3:K".$line."),2)";
$count["d_statement_money"] = "=ROUND(SUM(L3:L".$line."),2)";
$count["platform_amount"] = "=ROUND(SUM(E3:E".$line."),2)";
$count["platform_amount2"] = "=ROUND(SUM(F3:F".$line."),2)";
$count["fine"] = "=ROUND(SUM(L3:L".$line."),2)";
$count["reward"] = "=ROUND(SUM(M3:M".$line."),2)";
$count["statement_money"] = "=ROUND(SUM(N3:N".$line."),2)";
$count["fine"] = "=ROUND(SUM(M3:M".$line."),2)";
$count["reward"] = "=ROUND(SUM(N3:N".$line."),2)";
$count["statement_money"] = "=ROUND(SUM(P3:P".$line."),2)";
$count["statement_money_s"] = "=ROUND(SUM(Q3:Q".$line."),2)";
}
// dd($infolist);
$this->assign("data",$infolist);
@ -1693,7 +1953,7 @@ class CompanyStatementPoolController extends ThinkController
$clsi = SM("company_lack_statement_info","tab_")->where("is_pool = 1 and id in ({$create_lack_ids})")->find();
$re_op = true;
if(!empty($clsi)){
$re_op = false; //被引用无法重算
// $re_op = false; //被引用无法重算
}
}
if($re_op){
@ -1953,9 +2213,9 @@ class CompanyStatementPoolController extends ThinkController
}
}
// if(($info['verify_status'] == '6' || $info['verify_status'] == '0') &&$info['withdraw_type'] != "特殊补点") {
if(($info['verify_status'] == '6' || $info['verify_status'] == '0') &&!($info['company_type'] == 2 && $info['withdraw_type'] == "特殊补点")) {
array_push($optist,"editPool");
// }
}
if(empty($info['ext_file'])){
//未上传凭证
@ -2012,7 +2272,7 @@ class CompanyStatementPoolController extends ThinkController
}
return $resarr;
}
//编辑个人结算单
public function editCompanyStatementPool() {
$data = $_POST;
@ -2046,7 +2306,7 @@ class CompanyStatementPoolController extends ThinkController
// dump($increment_ratio);
// dump($st);
//die();
foreach ($increment_ratio as $key => $value) {
foreach ($st as $key => $value) {
$statement_info = array();
foreach($value as $akey => $aval) {
@ -2073,6 +2333,11 @@ class CompanyStatementPoolController extends ThinkController
$statement_data = $model->where(['id'=>$key])->find();
if ($statement_data['is_reward_fine_split'] == 1) {
$model->where(['id'=>$key])->save(['remark'=>$remark[$key][$st[$key][$akey]]]);
break;
}
$statement_info = json_decode($statement_data['statement_info'],true);
foreach ($statement_info as $k => $v) {
@ -2106,9 +2371,120 @@ class CompanyStatementPoolController extends ThinkController
}
// if ($key == 2312) {
// dump($statement_info);
// }
$statement_info_data = json_encode($statement_info);
$r_data = $model->field("fine,reward")->where(['id'=>$key])->find();
if($model == SM("company_statement_info","tab_")) {
$reward += $r_data['reward'];
$fine += $r_data['fine'];
} else {
$lreward += $r_data['reward'];
$lfine += $r_data['fine'];
}
$model->where(['id'=>$key])->save(['statement_info'=>$statement_info_data,'statement_money'=>$amount+($r_data['reward']?$r_data['reward']:0)-($r_data['fine']?$r_data['fine']:0),'pay_amount'=>$amount,'remark'=>$remark[$key][$st[$key][$akey]]]);
$amount = 0;
}
}
//die();
SM("company_statement_pool","tab_")->where(['id'=>$id])->save(['pay_amount'=>$statement_amount,'statement_money'=>$statement_amount+$reward-$fine,'lack_statement_money'=>$statement_lack_amount+$lreward-$lfine]);
$this->ajaxReturn(['status'=>1,'info'=>'保存成功']);
}
//编辑公司结算单
public function editCompanyStatementPoolPc() {
$data = $_POST;
if (!$data) {
$this->ajaxReturn(['status'=>0,'info'=>'数据错误']);
}
$ratio = $data['ratio'];
$refund = $data['refund'];
$withhold = $data['withhold'];
$increment_ratio = $data['increment_ratio'];
$sum_money = $data['sum_money'];
$st = $data['st'];
$id = $data['id'];
$remark = $data['remark'];
$amount = 0;
$statement_amount = 0;
$statement_lack_amount = 0;
$reward = 0;
$fine = 0;
$lreward = 0;
$lfine = 0;
$handledata = [];
// dump($sum_money);
// dump($ratio);
// dump($refund);
// dump($withhold);
// dump($increment_ratio);
// dump($st);
//die();
foreach ($st as $key => $value) {
$statement_info = array();
foreach($value as $akey => $aval) {
if ($st[$key][$akey] == 1) {
$model = SM("company_statement_info","tab_");
if (!$handledata[$key][1]) {
$handledata[$key][1] = 1;
} else {
continue;
}
} else {
$model = SM("company_lack_statement_info","tab_");
if (!$handledata[$key][0]) {
$handledata[$key][0] = 1;
} else {
continue;
}
}
$statement_data = $model->where(['id'=>$key])->find();
if ($statement_data['is_reward_fine_split'] == 1) {
$model->where(['id'=>$key])->save(['remark'=>$remark[$key][$st[$key][$akey]]]);
break;
}
$statement_info = json_decode($statement_data['statement_info'],true);
foreach ($statement_info as $k => $v) {
if ($ratio[$key][$v['game_name'].$v['statement_begin_time']]) {
$statement_info[$k]['ratio'] = (int)$ratio[$key][$v['game_name'].$v['statement_begin_time'].'-'.$v['statement_end_time']];
}
$statement_info[$k]['refund'] = $refund[$key][$v['game_name'].$v['statement_begin_time'].'-'.$v['statement_end_time']];
$statement_info[$k]['withhold'] = $withhold[$key][$v['game_name'].$v['statement_begin_time'].'-'.$v['statement_end_time']];
$withhold[$key][$v['game_name'].$v['statement_begin_time'].'-'.$v['statement_end_time']] = 0;
$statement_info[$k]['sum_money'] = $sum_money[$key][$v['game_name'].$v['statement_begin_time'].'-'.$v['statement_end_time']];
$amount += $sum_money[$key][$v['game_name'].$v['statement_begin_time'].'-'.$v['statement_end_time']] - $statement_info[$k]['withhold'];
if ($st[$key][$akey] == 1) {
$statement_amount += $sum_money[$key][$v['game_name'].$v['statement_begin_time'].'-'.$v['statement_end_time']]-$statement_info[$k]['withhold'];
} else {
$statement_lack_amount += $sum_money[$key][$v['game_name'].$v['statement_begin_time'].'-'.$v['statement_end_time']]-$statement_info[$k]['withhold'];
}
}
$statement_info_data = json_encode($statement_info);
@ -2319,4 +2695,131 @@ class CompanyStatementPoolController extends ThinkController
}
}
public function splitRewardOrFailData() {
if (!$_REQUEST['id']||!isset($_REQUEST['st'])) {
$this->ajaxReturn(['msg'=>'数据传输错误','status'=>'0']);
}
$id = $_REQUEST['id'];
$st = $_REQUEST['st'];
if ($st == 1) {
$model = SM("company_statement_info","tab_");
} else {
$model = SM("company_lack_statement_info","tab_");
}
$info = $model
->where(['id'=>$id])
->find();
$statement_info = json_decode($info['statement_info'],true);
// $reward_data = [];
// $fine_data = [];
$handle_statement_data = [];
$settlementAmount = 0;
if ($info['company_type'] == 2) {
foreach ($statement_info as $key => $value) {
$game_info = $value['game_list'];
$handle_statement_data[$key]['account'] = $value['account'];
foreach ($game_info as $gkey => $gvalue) {
// $time_key = $gvalue['statement_begin_time'].$gvalue['statement_end_time'];
$handle_statement_data[$key]['game_list'][$gkey]['game_name'] = '--';
$handle_statement_data[$key]['game_list'][$gkey]['game_type_name'] = '--';
$handle_statement_data[$key]['game_list'][$gkey]['statement_begin_time'] = $gvalue['statement_begin_time'];
$handle_statement_data[$key]['game_list'][$gkey]['statement_end_time'] = $gvalue['statement_end_time'];
$handle_statement_data[$key]['game_list'][$gkey]['reward'] = $gvalue['reward'];
$handle_statement_data[$key]['game_list'][$gkey]['fine'] = $gvalue['fine'];
$handle_statement_data[$key]['game_list'][$gkey]['pay_amount'] = 0;
$handle_statement_data[$key]['game_list'][$gkey]['all_pay_amount'] = 0;
$handle_statement_data[$key]['game_list'][$gkey]['sum_money'] = 0;
$statement_info[$key]['game_list'][$gkey]['reward'] = 0;
$statement_info[$key]['game_list'][$gkey]['fine'] = 0;
$settlementAmount += $gvalue['reward']-$gvalue['fine'];
}
}
} else {
foreach ($statement_info as $key => $value) {
$handle_statement_data[$key]['game_name'] = '--';
$handle_statement_data[$key]['game_type_name'] = '--';
$handle_statement_data[$key]['statement_begin_time'] = $value['statement_begin_time'];
$handle_statement_data[$key]['statement_end_time'] = $value['statement_end_time'];
$handle_statement_data[$key]['reward'] = $value['reward'];
$handle_statement_data[$key]['fine'] = $value['fine'];
$handle_statement_data[$key]['pay_amount'] = 0;
$handle_statement_data[$key]['all_pay_amount'] = 0;
$handle_statement_data[$key]['sum_money'] = 0;
$statement_info[$key]['reward'] = 0;
$statement_info[$key]['fine'] = 0;
$settlementAmount += $value['reward']-$value['fine'];
}
}
// dump($reward_data);
// dump($fine_data);
// die();
if (!$handle_statement_data) {
$this->ajaxReturn(['msg'=>'没有奖罚数据','status'=>'0']);
}
if ($settlementAmount <= 0) {
$this->ajaxReturn(['msg'=>'奖罚结算小于等于0不分离','status'=>'0']);
}
$save['pool_id'] = $info['pool_id']?$info['pool_id']:$_REQUEST['pool_id'];
$save['company_id'] = $info['company_id'];
$save['company_type'] = $info['company_type'];
$save['company_name'] = $info['company_name'];
$save['company_info'] = $info['company_info'];
$save['statement_begin_time'] = $info['statement_begin_time'];
$save['statement_end_time'] = $info['statement_end_time'];
$save['statement_num'] = "JS_" . date("YmdHis", time()) . $info['company_id'] . sp_random_string(5);
$save['withdraw_type'] = $info['withdraw_type'];
$save['verify_status'] = $info['verify_status'];
$save['statement_money'] = $settlementAmount;
$save['pay_amount'] = $settlementAmount;
$save['platform_amount'] = $settlementAmount;
$save['is_reward_fine_split'] = 1;
$handle_statement_data = json_encode($handle_statement_data);
//罚款数据
$save['statement_info'] = $handle_statement_data;
$save['reward'] = $info['reward'];
$save['fine'] = $info['fine'];
//罚款新增
SM("company_statement_info","tab_")->add($save);
$model->where(['id'=>$id])->save(['reward'=>0,'fine'=>0,'statement_info'=>json_encode($statement_info),'statement_money'=>$info['statement_money']-$settlementAmount,'pay_amount'=>$info['pay_amount']-$settlementAmount]);
$this->ajaxReturn(['msg'=>'执行成功','status'=>'1']);
}
}

@ -263,7 +263,7 @@ class CompanyStatementSetController extends Controller {
$statement_end_time = date("Y.m.d",$endtime);
foreach($cpList as $k=>$v){
$add_data=[];
$handleed_data = [];
//1.获取甲乙方信息
if($v['first_company_type'] == 1){
//甲方上游
@ -351,6 +351,22 @@ class CompanyStatementSetController extends Controller {
$game['statement_begin_time']=$statement_begin_time;
$game['statement_end_time']=$statement_end_time;
$game['statement_type']=0;
$RewardRecordRes = $this->getPromoteUserGameRewardRecordCp($add_data['company_id'],$statement_begin_time,$statement_end_time);
if (
($handleed_data[$v['id'].$statement_begin_time.$statement_end_time]['fine'] || $handleed_data[$v['id'].$statement_begin_time.$statement_end_time]['fine'] == '0')
|| ($handleed_data[$v['id'].$statement_begin_time.$statement_end_time]['reward'] || $handleed_data[$v['id'].$statement_begin_time.$statement_end_time]['reward'] == '0')
) {
$game['fine'] = 0;
$game['reward'] = 0;
} else {
$game['fine'] = $RewardRecordRes['fine']?$RewardRecordRes['fine']:0;
$game['reward'] = $RewardRecordRes['reward']?$RewardRecordRes['reward']:0;
$handleed_data[$v['id'].$statement_begin_time.$statement_end_time]['fine'] = (string)$RewardRecordRes['fine'];
$handleed_data[$v['id'].$statement_begin_time.$statement_end_time]['reward'] = (string)$RewardRecordRes['reward'];
}
$add_data['statement_info'][] = $game;
}
}else{
@ -710,6 +726,9 @@ class CompanyStatementSetController extends Controller {
if(!isset($v['game_list'])){continue;}
//获取多段比例
$game_ratio_list = D("CompanyGameRatio")->getPromoteCompanyGameRatio($add_data['company_id'],$v['game_ids'],$begintime,$endtime,$company_belong);
$handleed_data = [];
foreach ($game_ratio_list as $t_game_id => $t_game_ratio) {
$game =[];
$game['game_name'] =$v['game_list'][$t_game_id]['game_name'];
@ -774,6 +793,21 @@ class CompanyStatementSetController extends Controller {
$game['ratio']=$tratio;
}
$RewardRecordRes = $this->getPromoteUserGameRewardRecord($add_data['company_id'],$statement_begin_time,$statement_end_time);
if (
($handleed_data[$v['id'].$statement_begin_time.$statement_end_time]['fine'] || $handleed_data[$v['id'].$statement_begin_time.$statement_end_time]['fine'] == '0')
|| ($handleed_data[$v['id'].$statement_begin_time.$statement_end_time]['reward'] || $handleed_data[$v['id'].$statement_begin_time.$statement_end_time]['reward'] == '0')
) {
$game['fine'] = 0;
$game['reward'] = 0;
} else {
$game['fine'] = $RewardRecordRes['fine']?$RewardRecordRes['fine']:0;
$game['reward'] = $RewardRecordRes['reward']?$RewardRecordRes['reward']:0;
$handleed_data[$v['id'].$statement_begin_time.$statement_end_time]['fine'] = (string)$RewardRecordRes['fine'];
$handleed_data[$v['id'].$statement_begin_time.$statement_end_time]['reward'] = (string)$RewardRecordRes['reward'];
}
$game['sum_money']=round($game['pay_amount']*$tratio*(100-$fax_ratio)/(100*100),2);//结算金额=平台总额*(分成比例+补点比例)*(1-税费费率)
$add_data['statement_money'] += $game['sum_money'];
if ($game['pay_amount'] != '0') {
@ -826,6 +860,22 @@ class CompanyStatementSetController extends Controller {
}else{
$temp_game['ratio']=$tratio;
}
$RewardRecordRes = $this->getPromoteUserGameRewardRecord($add_data['company_id'],$temp_game['statement_begin_time'],$temp_game['statement_end_time']);
if (
($handleed_data[$v['id'].$statement_begin_time.$statement_end_time]['fine'] || $handleed_data[$v['id'].$statement_begin_time.$statement_end_time]['fine'] == '0')
|| ($handleed_data[$v['id'].$statement_begin_time.$statement_end_time]['reward'] || $handleed_data[$v['id'].$statement_begin_time.$statement_end_time]['reward'] == '0')
) {
$game['fine'] = 0;
$game['reward'] = 0;
} else {
$game['fine'] = $RewardRecordRes['fine']?$RewardRecordRes['fine']:0;
$game['reward'] = $RewardRecordRes['reward']?$RewardRecordRes['reward']:0;
$handleed_data[$v['id'].$statement_begin_time.$statement_end_time]['fine'] = (string)$RewardRecordRes['fine'];
$handleed_data[$v['id'].$statement_begin_time.$statement_end_time]['reward'] = (string)$RewardRecordRes['reward'];
}
$temp_game['sum_money']=round($temp_game['pay_amount']*$tratio*(100-$fax_ratio)/(100*100),2);//结算金额=平台总额*(分成比例+补点比例)*(1-税费费率)
$add_data['statement_money'] += $temp_game['sum_money'];
if ($temp_game['pay_amount'] != '0') {
@ -2081,6 +2131,41 @@ class CompanyStatementSetController extends Controller {
}
}
/**
* 获取上游游戏奖罚
*/
protected function getPromoteUserGameRewardRecordCp($cpmpamy_id,$begintime,$endtime)
{
$begintime = strtotime(str_replace('.','-',$begintime));
$endtime = strtotime(str_replace('.','-',$endtime))+86499;
//获取所有公司的奖罚
$rrmap = array(
"d.confirm_time" => ['between', [$begintime,$endtime]],
"d.company_type"=>1,
"d.company_id"=>$cpmpamy_id,
"d.settlement_type"=>2,
// "relation_game_id"=>$relation_game_id,
);
$rfres = M("RewardDetail","tab_")
->alias("d")
->field("
IFNULL(SUM(CASE WHEN type = 1 THEN amount ELSE 0 END),0) as reward,
IFNULL(SUM(CASE WHEN type = 2 THEN amount ELSE 0 END),0) as fine")
->join('tab_reward_record as r on d.record_id = r.id', 'LEFT')
->where($rrmap)
->group("company_id")
->find();
if(empty($rfres)){
return false;
}else{
return $rfres;
}
}
/**
* 获取公司奖罚
*/

@ -15,6 +15,7 @@ class MarketPercentageController extends ThinkController
protected $coefficient = [];
//实例化离职服务类
private $leavePercentage;
private $unSettlementList;
protected function _initialize()
{
@ -31,6 +32,7 @@ class MarketPercentageController extends ThinkController
$this->leavePercentage = $instance->factoryClass("LeavePercentage");
//不结算列表
$this->leavePercentage->unSettlementList();
$this->unSettlementList = $this->leavePercentage->returnUnSettlementList();
parent::_initialize();
}
@ -749,6 +751,9 @@ class MarketPercentageController extends ThinkController
// dump($this->leavePercentage->isSettlement($value['pay_time'],$value['admin_id']));
//离职结算判断
!($this->leavePercentage->isSettlement($value['pay_time'],$value['admin_id']))?$data[$key]['achievement_bonus']=0:'';
if ($this->unSettlementList[$value['admin_id']]&&date("Y-m",$this->unSettlementList[$value['admin_id']])<=$value['pay_time']) {
$data[$key]['leave_time'] = date("Y-m-d",$this->unSettlementList[$value['admin_id']]);
}
$data[$key]['start_time'] = date("Y-m-1", strtotime($value['pay_time']));
$data[$key]['end_time'] = date("Y-m-t", strtotime($value['pay_time']));

@ -0,0 +1,690 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" type="text/css" href="__CSS__/base.css" media="all">
<link rel="stylesheet" type="text/css" href="__CSS__/common.css" media="all">
<link rel="stylesheet" type="text/css" href="__CSS__/style.css" media="all">
<link rel="stylesheet" type="text/css" href="__CSS__/default_color.css" media="all">
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" />
<script type="text/javascript" src="__STATIC__/jquery-2.0.3.min.js"></script>
<script type="text/javascript" src="__STATIC__/jquery.form.js"></script>
<script type="text/javascript" src="__JS__/select2.min.js"></script>
<script type="text/javascript" src="__STATIC__/layer3/layer.js"></script>
<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__/juicer-min.js" type="text/javascript"></script>
<script src="__STATIC__/table2excel.js"></script>
</head>
<style>
html {
min-width:100%;
}
body {
padding: 0px 10px 150px 10px;
/* width: 960px; */
margin: auto;
}
/* .tabcon1711 table{
width: 480px;
} */
table{
margin: auto;
}
tr{
border-bottom: dotted 1px #c7c7c7;
}
.hidebox{
display: none;
}
.r{
width: 300px;
}
.l{
width: 180px;
}
.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;
}
.input-list, .i_list {
float: left;
margin: 0;
}
</style>
<body>
<!-- <div style="width: 100%;line-height: 100px;font-size: 25px;font-weight: 600;text-align: center;">
海南万盟天下科技有限公司
</div> -->
<div class="data_list box_mt" style="margin-top: 10px;">
<div class="">
<form id="form" method="post" class="form-horizontal" action="{:U('editCompanyStatementPoolPc')}" enctype="multipart/form-data" target="rfFrame">
<table id="exporttable">
<!-- 表头 -->
<thead>
<tr>
<th rowspan="2" style="border-right: solid 1px #b6cad2;">合作公司</th>
<th rowspan="2" style="border-right: solid 1px #b6cad2;">平台</th>
<th rowspan="2" style="border-right: solid 1px #b6cad2;">结算日期</th>
<th rowspan="2" style="border-right: solid 1px #b6cad2;">产品</th>
<th rowspan="2" style="border-right: solid 1px #b6cad2;">平台流水</th>
<th rowspan="2" style="border-right: solid 1px #b6cad2;">未结算平台流水</th>
<th rowspan="2" style="border-right: solid 1px #b6cad2;">退款</th>
<th colspan=2 style="border-right: solid 1px #b6cad2;">分成比例</th>
<th rowspan="2" style="border-right: solid 1px #b6cad2;">渠道费率</th>
<th rowspan="2" style="border-right: solid 1px #b6cad2;">税费费率</th>
<th rowspan="2" style="border-right: solid 1px #b6cad2;">合作方待结算分成</th>
<th rowspan="2" style="border-right: solid 1px #b6cad2;">违规罚款</th>
<th rowspan="2" style="border-right: solid 1px #b6cad2;">奖励</th>
<th rowspan="2" style="border-right: solid 1px #b6cad2;">其他扣款</th>
<th rowspan="2" style="border-right: solid 1px #b6cad2;">周期结算金额</th>
<!-- <th rowspan="2" style="border-right: solid 1px #b6cad2;">周结算金额</th>-->
<th rowspan="2" style="border-right: solid 1px #b6cad2;">合作待结算金额</th>
<th rowspan=2 style="border-right: solid 1px #b6cad2;">是否结算</th>
<th rowspan=2 style="border-right: solid 1px #b6cad2;">是否支付宝打款</th>
<th colspan=3 style="border-right: solid 1px #b6cad2;">账户信息</th>
<th rowspan="2" style="border-right: solid 1px #b6cad2;">备注</th>
<if condition="!$is_export">
<th rowspan="2" style="border-right: solid 1px #b6cad2;">操作</th>
</if>
</tr>
<tr>
<th style="border-right: solid 1px #b6cad2;min-width: 50px;">合作方</th>
<th style="min-width: 50px;">我方</th>
<th style="border-right: solid 1px #b6cad2;min-width: 50px;">户名</th>
<th style="border-right: solid 1px #b6cad2;min-width: 50px;">账号</th>
<th style="min-width: 50px;">开户行</th>
</tr>
</thead>
<tbody id="statementShow">
<foreach name="data" item="com">
<tr>
<td rowspan="{$com.statement_count}">{$com.company_name}</td>
<td rowspan="{$com.statement_count}">{$com.matche_platform}</td>
<!-- <td rowspan="{$com.statement_count}">{$com.statement_begin_time} ~ {$com.statement_end_time}</td> -->
<td rowspan="{$com['statement_info'][0]['row']}">{$com['statement_info'][0]['time']}</td>
<!-- <td>{$com['statement_info'][0]['statement_begin_time']}-{$com['statement_info'][0]['statement_end_time']}</td>-->
<td>{$com['statement_info'][0]['game_name']}</td>
<td class="pay_amount">{$com['statement_info'][0]['pay_amount']}</td>
<td>{$com['statement_info'][0]['pay_amount']}</td>
<td >
<!-- {$com['statement_info'][0]['refund']|default=0}-->
<if condition="($com.is_reward_fine_split eq 0)">
<input class="refund" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$com['statement_info'][0]['refund']|default=0}" style="width: 40px;" name="refund[{$com['id']}][{$com['statement_info'][0]['game_name']}{$com['statement_info'][0]['time']}]">
<else/>
0
</if>
</td>
<td>
{$com['statement_info'][0]['ratio']|showNumPercent}
<if condition="($com.is_reward_fine_split eq 0)">
<input class="ratio" onkeyup ="if(value>100){value=100}else{value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')}if(value.indexOf(0)==0){value=0}" name="ratio[{$com['id']}][{$com['statement_info'][0]['game_name']}{$com['statement_info'][0]['time']}]" value="{$com['statement_info'][0]['ratio']}" style="width: 25px;display: none">
</if>
</td>
<td>{$com['statement_info'][0]['company_ratio']|showNumPercent}</td>
<td>{$com['statement_info'][0]['promote_ratio']|showNumPercent}</td>
<td>
{$com['statement_info'][0]['fax_ratio']|showNumPercent}
<if condition="($com.is_reward_fine_split eq 0)">
<input class="fax_ratio" onkeyup ="if(value>100){value=100}else{value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')}if(value.indexOf(0)==0){value=0}" name="fax_ratio[{$com['id']}][{$com['statement_info'][0]['game_name']}{$com['statement_info'][0]['time']}]" value="{$com['statement_info'][0]['fax_ratio']}" style="width: 25px;display: none">
</if>
</td>
<td>
<span class="sum_money_span">{$com['statement_info'][0]['d_statement_money']}</span>
<input class="sum_money" name="sum_money[{$com['id']}][{$com['statement_info'][0]['game_name']}{$com['statement_info'][0]['time']}]" value="{$com['statement_info'][0]['d_statement_money']}" style="width: 20px;display: none">
<input class="st" name="st[{$com['id']}][{$com['statement_info'][0]['game_name']}{$com['statement_info'][0]['time']}]" value="{$com['st']}" style="width: 20px;display: none">
</td>
<td rowspan="{$com['statement_info'][0]['row']}">{$com['fine']-0}</td>
<td rowspan="{$com['statement_info'][0]['row']}">{$com['reward']-0}</td>
<td rowspan="{$com['statement_info'][0]['row']}">
<if condition="($com.is_reward_fine_split eq 0)">
<input class="withhold" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$com['statement_info'][0]['withhold']|default=0}" style="width: 40px;" name="withhold[{$com['id']}][{$com['statement_info'][0]['game_name']}{$com['statement_info'][0]['time']}]">
<input class="oldwithhold" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$com['statement_info'][0]['withhold']|default=0}" style="width: 40px;display: none">
<else/>
0
</if>
</td>
<td rowspan="{$com['statement_info'][0]['row']}">
<span class="week_amount">{$com['statement_info'][0]['week_amount']}</span>
</td>
<!-- <td rowspan="{$com['statement_info'][0]['row']}">{$com['statement_info'][0]['week_amount']}</td>-->
<td rowspan="{$com.statement_count}" class="statement_money">{$com['statement_money']}</td>
<td rowspan="{$com.statement_count}"><if condition="$com['st'] eq 0"><else /></if></td>
<td rowspan="{$com.statement_count}"><if condition="$com['is_payment'] eq 1"><else /></if></td>
<if condition="$com['is_payment'] eq 2">
<td rowspan="{$com.statement_count}">{$com.company_info.payee_name}</td>
<td rowspan="{$com.statement_count}">&nbsp;{$com.company_info.bank_account}</td>
<td rowspan="{$com.statement_count}">{$com.company_info.opening_bank}</td>
</if>
<if condition="$com['is_payment'] eq 1">
<td rowspan="{$com.statement_count}">{$com.company_info.ali_user}</td>
<td rowspan="{$com.statement_count}">{$com.company_info.ali_account}</td>
<td rowspan="{$com.statement_count}"></td>
</if>
<td rowspan="{$com.statement_count}"><textarea name="remark[{$com['id']}][{$com['st']}]">{$com.remark}</textarea></td>
<if condition="!$is_export">
<td rowspan="{$com.statement_count}">
<if condition="($com['st'] eq 1 ) AND ($pool_status lt 1) AND ($com.is_reward_fine_split eq 0)">
<a data-id="{$com['id']}" class='butn no_statement' style="cursor:pointer">不结算</a>
</if>
<if condition="($pool_status lt 1) AND ($com.is_reward_fine_split eq 0)">
<a data-id="{$com['id']}" data-st="{$com['st']}" class='butn split_RewardOrFail' style="cursor:pointer">奖惩分离</a>
</if>
</td>
</if>
</tr>
<foreach name="com.statement_info" item="it" key="k">
<if condition="$k neq 0">
<tr>
<!-- <td>{$it['statement_begin_time']}-{$it['statement_end_time']}</td>-->
<notempty name="it['time']">
<td rowspan="{$it['row']}">{$it['time']}</td>
</notempty>
<td>{$it['game_name']}</td>
<td><span class="pay_amount">{$it['pay_amount']}</span></td>
<td>{$it['pay_amount']}</td>
<td>
<if condition="($com.is_reward_fine_split eq 0)">
<input class="refund" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$it['refund']|default=0}" style="width: 40px;" name="refund[{$com['id']}][{$it['game_name']}{$it['time']?$it['time']:$com['statement_info'][0]['time']}]">
<else/>
0
</if>
</td>
<td>
{$it['ratio']|showNumPercent}
<if condition="($com.is_reward_fine_split eq 0)">
<input class="ratio" onkeyup ="if(value>100){value=100}else{value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')}if(value.indexOf(0)==0){value=0}" name="ratio[{$com['id']}][{$it['game_name']}{$it['time']?$it['time']:$com['statement_info'][0]['time']}]" value="{$it['ratio']}" style="width: 25px;display: none">
</if>
</td>
<td>{$it['company_ratio']|showNumPercent}</td>
<td>{$it['promote_ratio']|showNumPercent}</td>
<td>
{$it['fax_ratio']|showNumPercent}
<if condition="($com.is_reward_fine_split eq 0)">
<input class="fax_ratio" onkeyup ="if(value>100){value=100}else{value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')}if(value.indexOf(0)==0){value=0}" name="fax_ratio[{$com['id']}][{$it['game_name']}{$it['time']?$it['time']:$com['statement_info'][0]['time']}]" value="{$it['fax_ratio']}" style="width: 25px;display: none">
</if>
</td>
<td>
<span class="sum_money_span">{$it['d_statement_money']}</span>
<input class="sum_money" name="sum_money[{$com['id']}][{$it['game_name']}{$it['time']?$it['time']:$com['statement_info'][0]['time']}]" value="{$it['d_statement_money']}" style="width: 20px;display: none">
<input class="st" name="st[{$com['id']}][{$it['game_name']}{$it['time']?$it['time']:$com['statement_info'][0]['time']}]" value="{$com['st']}" style="width: 20px;display: none">
</td>
<notempty name="it['time']">
<td rowspan="{$it['row']}">{$it['fine']-0}</td>
<td rowspan="{$it['row']}">{$it['reward']-0}</td>
<td>
<if condition="($com.is_reward_fine_split eq 0)">
<input class="withhold" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$it['withhold']|default=0}" style="width: 40px;" name="withhold[{$com['id']}][{$it['game_name']}{$it['time']?$it['time']:$com['statement_info'][0]['time']}]">
<input class="oldwithhold" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$it['withhold']|default=0}" style="width: 40px;display: none">
<else/>
0
</if>
</td>
<td rowspan="{$it['row']}"><span class="week_amount">{$it['week_amount']}</span></td>
</notempty>
</tr>
</if>
</foreach>
</foreach>
<tr>
<td colspan=4 >合计:</td>
<td>{$count.platform_amount}</td>
<td>{$count.platform_amount2}</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>{$count.d_statement_money}</td>
<td>{$count.fine}</td>
<td>{$count.reward}</td>
<td></td>
<td class="count_sum_money">{$count.statement_money}</td>
<td class="count_sum_money">{$count.statement_money}</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<if condition="!$is_export">
<td></td>
</if>
</tr>
<if condition="$is_export">
<tr>
<td ></td>
<td>
<if condition="$pool_data.verify_status eq -3 ">
<div style="line-height: 2;color: red;">
{$pool_data.firstverify}
</div>
<else />
<div style="line-height: 2;">
{$pool_data.firstverify}
</div>
</if>
</td>
<td>
<if condition="$pool_data.verify_status eq -1 ">
<div style="line-height: 2;color: red;">
{$pool_data.verify}
</div>
<else />
<div style="line-height: 2;">
{$pool_data.verify}
</div>
</if>
</td>
<td>
<if condition="$pool_data.verify_status eq -2 ">
<div style="line-height: 2;color: red;">
{$pool_data.payment}
</div>
<else />
<div style="line-height: 2;">
{$pool_data.payment}
</div>
</if>
</td>
</tr>
</if>
</tbody>
</table>
<input type="hidden" name="id" value="{$_GET['id']}">
</form>
<div class="form-item cf" style="float: right;margin-top: 30px;margin-right: 30px;">
<button class="submit_btn" id="submit" style="margin-left:210px;">
保存
</button>
</div>
<iframe id="rfFrame" name="rfFrame" src="about:blank" style="display:none;"></iframe>
</div>
</div>
</body>
<script>
<if condition="$is_export">
$(function(){
$("#exporttable").table2excel({
filename: "{$title}.xls", // do include extension
preserveColors: false // set to true if you want background colors and font colors preserved
});
});
</if>
// $(".no_statement").on("click",function(){
// var id = $(this).data('id');
// $.ajax({
// type: "POST",
// url: "{:U('cancelStatement')}",
// dataType: 'json',
// async: false,
// data: {id:id},
// success:function(data){
// if(data.status==1){
// layer.msg("<font style='color:white'>" + data.info + "</font>");
// setTimeout(function(){
// window.location.reload();
// },1500);
// }else{
// layer.msg("<font style='color:white'>" + data.info + "</font>");
// return false;
// }
// }
// });
// })
var pool_ids = "{$_GET['id']}";
$(".split_RewardOrFail").on("click",function() {
var id = $(this).data('id');
var st = $(this).data('st');
layer.confirm("是否确认对该数据进行奖惩分离", {title: false}, function (index) {
$.ajax({
type: "POST",
url: "{:U('splitRewardOrFailData')}",
dataType: 'json',
async: false,
data: {id: id, st: st, pool_id: pool_ids},
success: function (data) {
if (data.status == 1) {
layer.msg("<font style='color:white'>" + data.msg + "</font>");
setTimeout(function () {
window.location.reload();
}, 1500);
} else {
layer.msg("<font style='color:white'>" + data.msg + "</font>");
return false;
}
}
});
});
});
$(".no_statement").on("click",function(){
var id = $(this).data('id');
saveForm(id);
});
var return_data = "";
function saveForm(id) {
var options = {
url:"{:U('editCompanyStatementPoolPc')}", //同action
type:'post',
beforeSend:function(xhr){
},
success:function(data)
{
return_data = data;
},
complete:function(data){
if(return_data.status==1){
$.ajax({
type: "POST",
url: "{:U('cancelStatement')}",
dataType: 'json',
async: false,
data: {id:id},
success:function(data){
if(data.status==1){
layer.msg("<font style='color:white'>" + data.info + "</font>");
setTimeout(function(){
window.location.reload();
},1500);
}else{
layer.msg("<font style='color:white'>" + data.info + "</font>");
return false;
}
}
});
return;
}else{
layer.msg("<font style='color:white'>" + 保存数据失败 + "</font>");
return false;
}
},
error: function(xhr,status,msg){
//alert("状态码"+status+"; "+msg)
layer.msg('玩命加载中..');
}
};
$("#form").ajaxSubmit(options);
}
$("#submit").click(function(){
var options = {
url:"{:U('editCompanyStatementPoolPc')}", //同action
type:'post',
beforeSend:function(xhr){
},
success:function(data)
{
return_data = data;
},
complete:function(data){
if(return_data.status==1){
layer.msg("<font style='color:white'>" + return_data.info + "</font>");
setTimeout(function(){
parent.location.reload();
},1500);
}else{
layer.msg("<font style='color:white'>" + return_data.info + "</font>");
return false;
}
},
error: function(xhr,status,msg){
//alert("状态码"+status+"; "+msg)
layer.msg('玩命加载中..');
}
};
$("#form").ajaxSubmit(options);
});
$(".refund").on("blur",function () {
caculate_sum_money(this);
changeStatementAmount(this);
changeSumAmount();
});
$(".withhold").on("blur",function () {
caculate_sum_money(this);
changeStatementAmount(this);
changeSumAmount();
});
$(".ratio").on("blur",function () {
caculate_sum_money(this);
changeStatementAmount(this);
changeSumAmount();
});
$(".increment_ratio").on("blur",function () {
caculate_sum_money(this);
changeStatementAmount(this);
changeSumAmount();
});
var withdraw_type = "{$withdraw_type}";
// 分成结算金额重算
function caculate_sum_money(_this) {
var pay_money = $(_this).parent().parent().find(".pay_amount").text();
var ratio = $(_this).parent().parent().find(".ratio").val();
//比例金额
if (!ratio || ratio < 0) {
ratio = 0;
$(_this).parent().parent().find(".ratio").val(ratio);
} else if (ratio > 100) {
ratio = 100;
$(_this).parent().parent().find(".ratio").val(ratio);
}
//退款
var refund = $(_this).parent().parent().find(".refund").val();
if (!refund || refund < 0) {
refund = 0;
$(_this).parent().parent().find(".refund").val(refund);
} else if(parseFloat(refund) > parseFloat(pay_money)) {
refund = pay_money;
$(_this).parent().parent().find(".refund").val(refund);
}
//退款
var withhold = $(_this).parent().parent().find(".withhold").val();
var oldwithhold = $(_this).parent().parent().find(".oldwithhold").val();
// console.log(withhold-oldwithhold);
if (!withhold ) {
withhold = 0;
$(_this).parent().parent().find(".withhold").val(withhold);
}
if (!oldwithhold ) {
oldwithhold = 0;
$(_this).parent().parent().find(".oldwithhold").val(oldwithhold);
}
// else if(parseFloat(withhold) > parseFloat(pay_money)) {
// withhold = pay_money;
// $(_this).parent().parent().find(".withhold").val(withhold);
// }
//补点
var increment_ratio = $(_this).parent().parent().find(".increment_ratio").val();
if (!increment_ratio || increment_ratio < 0) {
increment_ratio = 0;
$(_this).parent().parent().find(".increment_ratio").val(increment_ratio);
} else if(increment_ratio > 100) {
increment_ratio = 100;
$(_this).parent().parent().find(".increment_ratio").val(increment_ratio);
}
var week_amount_find = $(_this).parent().parent();
var old_amount = week_amount_find.find(".sum_money_span").text();
//扣款
pay_money = parseFloat(pay_money) - parseFloat(refund);
if (withdraw_type == 3) {
var value = parseFloat(pay_money)*(parseFloat(increment_ratio)/100);
} else {
var value = (parseFloat(pay_money)*(parseFloat(ratio)/100) + parseFloat(pay_money)*(parseFloat(increment_ratio)/100));
}
// var value = (parseFloat(pay_money)*(parseFloat(ratio)/100) + parseFloat(pay_money)*(parseFloat(increment_ratio)/100));
$(_this).parent().parent().find(".sum_money_span").text(value.toFixed(2));
$(_this).parent().parent().find(".sum_money").val(value.toFixed(2));
var this_amount = week_amount_find.find(".sum_money_span").text();
var week_amount = 0;
var i = 0;
for (;;) {
week_amount = week_amount_find.find(".week_amount").text();
i++;
// console.log(week_amount);
if (week_amount) {
break;
} else {
week_amount_find = week_amount_find.prev();
}
if (i>10) {
break;
}
}
var D_value = parseFloat(old_amount) - parseFloat(this_amount) + parseFloat(withhold-oldwithhold);
// console.log(D_value);
week_amount_find.find(".week_amount").text((parseFloat(week_amount) - D_value).toFixed(2));
$(_this).parent().parent().find(".oldwithhold").val(withhold)
}
//结算金额重算
function changeStatementAmount(_this) {
var _parent = $(_this).parent().parent();
var statement_amount = '';
var num = 0;
for (;;) {
statement_amount = _parent.find(".statement_money").text();
if (!statement_amount ) {
_parent = _parent.prev();
} else {
break;
}
num++;
// if (num>10) {
// break;
// }
}
var row = _parent.find(".statement_money").attr("rowspan");
var get_item = _parent;
var sum_amount = 0;
for (var i =0;i<parseInt(row);i++) {
var amount = get_item.find(".week_amount").text();
if (amount) {
sum_amount = parseFloat(sum_amount) + parseFloat(amount);
get_item = get_item.next();
} else {
get_item = get_item.next();
}
}
// console.log(sum_amount);
_parent.find(".statement_money").text(sum_amount.toFixed(2));
}
//结算金额合计重算
function changeSumAmount() {
var sum_amount = 0;
var st = 0;
$("#statementShow").find(".statement_money").each(function (key,val) {
st = $(val).data('st')
sum_amount = parseFloat(sum_amount) + parseFloat($(val).text());
});
$(".count_sum_money").text(sum_amount.toFixed(2));
}
</script>
</html>

@ -0,0 +1,687 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" type="text/css" href="__CSS__/base.css" media="all">
<link rel="stylesheet" type="text/css" href="__CSS__/common.css" media="all">
<link rel="stylesheet" type="text/css" href="__CSS__/style.css" media="all">
<link rel="stylesheet" type="text/css" href="__CSS__/default_color.css" media="all">
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" />
<script type="text/javascript" src="__STATIC__/jquery-2.0.3.min.js"></script>
<script type="text/javascript" src="__STATIC__/jquery.form.js"></script>
<script type="text/javascript" src="__JS__/select2.min.js"></script>
<script type="text/javascript" src="__STATIC__/layer3/layer.js"></script>
<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__/juicer-min.js" type="text/javascript"></script>
<script src="__STATIC__/table2excel.js"></script>
</head>
<style>
html {
min-width:100%;
}
body {
padding: 0px 10px 150px 10px;
/* width: 960px; */
margin: auto;
}
/* .tabcon1711 table{
width: 480px;
} */
table{
margin: auto;
}
tr{
border-bottom: dotted 1px #c7c7c7;
}
.hidebox{
display: none;
}
.r{
width: 300px;
}
.l{
width: 180px;
}
.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;
}
.input-list, .i_list {
float: left;
margin: 0;
}
</style>
<body>
<!-- <div style="width: 100%;line-height: 100px;font-size: 25px;font-weight: 600;text-align: center;">
海南万盟天下科技有限公司
</div> -->
<div class="data_list box_mt" style="margin-top: 10px;">
<div class="">
<form id="form" method="post" class="form-horizontal" action="{:U('editCompanyStatementPoolPc')}" enctype="multipart/form-data" target="rfFrame">
<table id="exporttable">
<!-- 表头 -->
<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>
<th>开户行</th>
<th>是否支付宝打款</th>
<th>是否结算</th>
<th>备注</th>
<if condition="!$is_export">
<th>操作</th>
</if>
</tr>
</thead>
<tbody id="statementShow">
<foreach name="data" item="com">
<tr>
<td rowspan="{$com.statement_count}">{$key-0+1}</td>
<td rowspan="{$com.statement_count}">{$com.company_name}</td>
<td rowspan="{$com['statement_info'][0]['row']}">{$com['statement_info'][0]['time']}</td>
<td>{$com['statement_info'][0]['game_name']}</td>
<td><span class="pay_amount">{$com['statement_info'][0]['pay_amount']}</span></td>
<td>
<if condition="($com.is_reward_fine_split eq 0)">
<input class="refund" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$com['statement_info'][0]['refund']|default=0}" style="width: 40px;" name="refund[{$com['id']}][{$com['statement_info'][0]['game_name']}{$com['statement_info'][0]['time']}]">
<else/>
0
</if>
</td>
<td>
{$com['statement_info'][0]['ratio']|showNumPercent}
<if condition="($com.is_reward_fine_split eq 0)">
<input class="ratio" onkeyup ="if(value>100){value=100}else{value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')}if(value.indexOf(0)==0){value=0}" name="ratio[{$com['id']}][{$com['statement_info'][0]['game_name']}{$com['statement_info'][0]['time']}]" value="{$com['statement_info'][0]['ratio']}" style="width: 25px;display: none">
</if>
</td>
<td>
{$com['statement_info'][0]['increment_ratio']|showNumPercent}
<if condition="($com.is_reward_fine_split eq 0)">
<input class="increment_ratio" onkeyup ="if(value>100){value=100}else{value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')}if(value.indexOf(0)==0){value=0}" name="increment_ratio[{$com['id']}][{$com['statement_info'][0]['game_name']}{$com['statement_info'][0]['time']}]" value="{$com['statement_info'][0]['increment_ratio']}" style="width: 25px;display: none">
</if>
</td>
<td>
{$com['statement_info'][0]['fax_ratio']|showNumPercent}
<if condition="($com.is_reward_fine_split eq 0)">
<input class="fax_ratio" onkeyup ="if(value>100){value=100}else{value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')}if(value.indexOf(0)==0){value=0}" name="fax_ratio[{$com['id']}][{$com['statement_info'][0]['game_name']}{$com['statement_info'][0]['time']}]" value="{$com['statement_info'][0]['fax_ratio']}" style="width: 25px;display: none">
</if>
</td>
<td>
<span class="sum_money_span">{$com['statement_info'][0]['d_statement_money']}</span>
<input class="sum_money" name="sum_money[{$com['id']}][{$com['statement_info'][0]['game_name']}{$com['statement_info'][0]['time']}]" value="{$com['statement_info'][0]['d_statement_money']}" style="width: 20px;display: none">
<input class="st" name="st[{$com['id']}][{$com['statement_info'][0]['game_name']}{$com['statement_info'][0]['time']}]" value="{$com['st']}" style="width: 20px;display: none">
</td>
<!-- <td rowspan="{$com.statement_count}">{$com['fine']-0}</td>-->
<!-- <td rowspan="{$com.statement_count}">{$com['reward']-0}</td>-->
<td rowspan="{$com['statement_info'][0]['row']}">{$com['statement_info'][0]['fine']-0}</td>
<td rowspan="{$com['statement_info'][0]['row']}">{$com['statement_info'][0]['reward']-0}</td>
<td rowspan="{$com['statement_info'][0]['row']}">
<if condition="($com.is_reward_fine_split eq 0)">
<input class="withhold" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$com['statement_info'][0]['withhold']|default=0}" style="width: 40px;" name="withhold[{$com['id']}][{$com['statement_info'][0]['game_name']}{$com['statement_info'][0]['time']}]">
<input class="oldwithhold" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$com['statement_info'][0]['withhold']|default=0}" style="width: 40px;display: none">
<else/>
0
</if>
</td>
<td rowspan="{$com['statement_info'][0]['row']}">
<span class="week_amount">{$com['statement_info'][0]['week_amount']}</span>
</td>
<td rowspan="{$com.statement_count}" class="statement_money">
{$com['statement_money']}
</td>
<td rowspan="{$com.statement_count}">{$com.settlement_contact}</td>
<!-- <td>{$com['statement_info'][0]['statement_begin_time']}-{$com['statement_info'][0]['statement_end_time']}</td>-->
<!-- <td rowspan="{$com['statement_info'][0]['row']}">{$com['statement_info'][0]['time']}</td>-->
<if condition="$com['is_payment'] eq 2">
<td rowspan="{$com.statement_count}">{$com.company_info.payee_name}</td>
<td rowspan="{$com.statement_count}">&nbsp;{$com.company_info.bank_account}</td>
<td rowspan="{$com.statement_count}">{$com.company_info.opening_bank}</td>
</if>
<if condition="$com['is_payment'] eq 1">
<td rowspan="{$com.statement_count}">{$com.company_info.ali_user}</td>
<td rowspan="{$com.statement_count}">{$com.company_info.ali_account}</td>
<td rowspan="{$com.statement_count}"></td>
</if>
<td rowspan="{$com.statement_count}"><if condition="$com['is_payment'] eq 1"><else /></if></td>
<td rowspan="{$com.statement_count}"><if condition="$com['st'] eq 0"><else /></if></td>
<td rowspan="{$com.statement_count}"><textarea name="remark[{$com['id']}][{$com['st']}]">{$com.remark}</textarea></td>
<if condition="!$is_export">
<td rowspan="{$com.statement_count}">
<if condition="($com['st'] eq 1 ) AND ($pool_status lt 1) AND ($com.is_reward_fine_split eq 0)">
<a data-id="{$com['id']}" class='butn no_statement' style="cursor:pointer">不结算</a>
</if>
<if condition="($pool_status lt 1) AND ($com.is_reward_fine_split eq 0)">
<a data-id="{$com['id']}" data-st="{$com['st']}" class='butn split_RewardOrFail' style="cursor:pointer">奖惩分离</a>
</if>
</td>
</if>
</tr>
<foreach name="com.statement_info" item="it" key="k">
<if condition="$k neq 0">
<tr>
<notempty name="it['time']">
<td rowspan="{$it['row']}">{$it['time']}</td>
</notempty>
<td>{$it['game_name']}</td>
<td><span class="pay_amount">{$it['pay_amount']}</span></td>
<td>
<if condition="($com.is_reward_fine_split eq 0)">
<input class="refund" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$it['refund']|default=0}" style="width: 40px;" name="refund[{$com['id']}][{$it['game_name']}{$it['time']?$it['time']:$com['statement_info'][0]['time']}]">
<else/>
0
</if>
</td>
<td>
{$it['ratio']|showNumPercent}
<if condition="($com.is_reward_fine_split eq 0)">
<input class="ratio" onkeyup ="if(value>100){value=100}else{value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')}if(value.indexOf(0)==0){value=0}" name="ratio[{$com['id']}][{$it['game_name']}{$it['time']?$it['time']:$com['statement_info'][0]['time']}]" value="{$it['ratio']}" style="width: 25px;display: none">
</if>
</td>
<td>
{$it['increment_ratio']|showNumPercent}
<if condition="($com.is_reward_fine_split eq 0)">
<input class="increment_ratio" onkeyup ="if(value>100){value=100}else{value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')}if(value.indexOf(0)==0){value=0}" name="increment_ratio[{$com['id']}][{$it['game_name']}{$it['time']?$it['time']:$com['statement_info'][0]['time']}]" value="{$it['increment_ratio']}" style="width: 25px;display: none">
</if>
</td>
<td>
{$it['fax_ratio']|showNumPercent}
<if condition="($com.is_reward_fine_split eq 0)">
<input class="fax_ratio" onkeyup ="if(value>100){value=100}else{value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')}if(value.indexOf(0)==0){value=0}" name="fax_ratio[{$com['id']}][{$it['game_name']}{$it['time']?$it['time']:$com['statement_info'][0]['time']}]" value="{$it['fax_ratio']}" style="width: 25px;display: none">
</if>
</td>
<td>
<span class="sum_money_span">{$it['d_statement_money']}</span>
<input class="sum_money" name="sum_money[{$com['id']}][{$it['game_name']}{$it['time']?$it['time']:$com['statement_info'][0]['time']}]" value="{$it['d_statement_money']}" style="width: 20px;display: none">
<input class="st" name="st[{$com['id']}][{$it['game_name']}{$it['time']?$it['time']:$com['statement_info'][0]['time']}]" value="{$com['st']}" style="width: 20px;display: none">
</td>
<!-- <td>{$it['statement_begin_time']}-{$it['statement_end_time']}</td>-->
<notempty name="it['time']">
<td rowspan="{$it['row']}">{$it['fine']-0}</td>
<td rowspan="{$it['row']}">{$it['reward']-0}</td>
<td>
<if condition="($com.is_reward_fine_split eq 0)">
<input class="withhold" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$it['withhold']|default=0}" style="width: 40px;" name="withhold[{$com['id']}][{$it['game_name']}{$it['time']?$it['time']:$com['statement_info'][0]['time']}]">
<input class="oldwithhold" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$it['withhold']|default=0}" style="width: 40px;display: none">
<else/>
0
</if>
</td>
<td rowspan="{$it['row']}"><span class="week_amount">{$it['week_amount']}</span></td>
</notempty>
</tr>
</if>
</foreach>
</foreach>
<tr>
<td colspan=3 >合计:</td>
<td></td>
<td>{$count.platform_amount}</td>
<td></td>
<td></td>
<td></td>
<td>{$count.d_statement_money}</td>
<td></td>
<td>{$count.fine}</td>
<td>{$count.reward}</td>
<td></td>
<td class="count_sum_money">{$count.statement_money}</td>
<td class="count_sum_money">{$count.statement_money}</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<if condition="!$is_export">
<td></td>
</if>
</tr>
<if condition="$is_export">
<tr>
<td ></td>
<td>
<if condition="$pool_data.verify_status eq -3 ">
<div style="line-height: 2;color: red;">
{$pool_data.firstverify}
</div>
<else />
<div style="line-height: 2;">
{$pool_data.firstverify}
</div>
</if>
</td>
<td>
<if condition="$pool_data.verify_status eq -1 ">
<div style="line-height: 2;color: red;">
{$pool_data.verify}
</div>
<else />
<div style="line-height: 2;">
{$pool_data.verify}
</div>
</if>
</td>
<td>
<if condition="$pool_data.verify_status eq -2 ">
<div style="line-height: 2;color: red;">
{$pool_data.payment}
</div>
<else />
<div style="line-height: 2;">
{$pool_data.payment}
</div>
</if>
</td>
</tr>
</if>
</tbody>
</table>
<input type="hidden" name="id" value="{$_GET['id']}">
</form>
<div class="form-item cf" style="float: right;margin-top: 30px;margin-right: 30px;">
<button class="submit_btn" id="submit" style="margin-left:210px;">
保存
</button>
</div>
<iframe id="rfFrame" name="rfFrame" src="about:blank" style="display:none;"></iframe>
</div>
</div>
</body>
<script>
<if condition="$is_export">
$(function(){
$("#exporttable").table2excel({
filename: "{$title}.xls", // do include extension
preserveColors: false // set to true if you want background colors and font colors preserved
});
});
</if>
// $(".no_statement").on("click",function(){
// var id = $(this).data('id');
// $.ajax({
// type: "POST",
// url: "{:U('cancelStatement')}",
// dataType: 'json',
// async: false,
// data: {id:id},
// success:function(data){
// if(data.status==1){
// layer.msg("<font style='color:white'>" + data.info + "</font>");
// setTimeout(function(){
// window.location.reload();
// },1500);
// }else{
// layer.msg("<font style='color:white'>" + data.info + "</font>");
// return false;
// }
// }
// });
// })
var pool_ids = "{$_GET['id']}";
$(".split_RewardOrFail").on("click",function() {
var id = $(this).data('id');
var st = $(this).data('st');
layer.confirm("是否确认对该数据进行奖惩分离", {title: false}, function (index) {
$.ajax({
type: "POST",
url: "{:U('splitRewardOrFailData')}",
dataType: 'json',
async: false,
data: {id: id, st: st, pool_id: pool_ids},
success: function (data) {
if (data.status == 1) {
layer.msg("<font style='color:white'>" + data.msg + "</font>");
setTimeout(function () {
window.location.reload();
}, 1500);
} else {
layer.msg("<font style='color:white'>" + data.msg + "</font>");
return false;
}
}
});
});
});
$(".no_statement").on("click",function(){
var id = $(this).data('id');
saveForm(id);
});
var return_data = "";
function saveForm(id) {
var options = {
url:"{:U('editCompanyStatementPoolPc')}", //同action
type:'post',
beforeSend:function(xhr){
},
success:function(data)
{
return_data = data;
},
complete:function(data){
if(return_data.status==1){
$.ajax({
type: "POST",
url: "{:U('cancelStatement')}",
dataType: 'json',
async: false,
data: {id:id},
success:function(data){
if(data.status==1){
layer.msg("<font style='color:white'>" + data.info + "</font>");
setTimeout(function(){
window.location.reload();
},1500);
}else{
layer.msg("<font style='color:white'>" + data.info + "</font>");
return false;
}
}
});
return;
}else{
layer.msg("<font style='color:white'>" + 保存数据失败 + "</font>");
return false;
}
},
error: function(xhr,status,msg){
//alert("状态码"+status+"; "+msg)
layer.msg('玩命加载中..');
}
};
$("#form").ajaxSubmit(options);
}
$("#submit").click(function(){
var options = {
url:"{:U('editCompanyStatementPoolPc')}", //同action
type:'post',
beforeSend:function(xhr){
},
success:function(data)
{
return_data = data;
},
complete:function(data){
if(return_data.status==1){
layer.msg("<font style='color:white'>" + return_data.info + "</font>");
setTimeout(function(){
parent.location.reload();
},1500);
}else{
layer.msg("<font style='color:white'>" + return_data.info + "</font>");
return false;
}
},
error: function(xhr,status,msg){
//alert("状态码"+status+"; "+msg)
layer.msg('玩命加载中..');
}
};
$("#form").ajaxSubmit(options);
});
$(".refund").on("blur",function () {
caculate_sum_money(this);
changeStatementAmount(this);
changeSumAmount();
});
$(".withhold").on("blur",function () {
caculate_sum_money(this);
changeStatementAmount(this);
changeSumAmount();
});
$(".ratio").on("blur",function () {
caculate_sum_money(this);
changeStatementAmount(this);
changeSumAmount();
});
$(".increment_ratio").on("blur",function () {
caculate_sum_money(this);
changeStatementAmount(this);
changeSumAmount();
});
var withdraw_type = "{$withdraw_type}";
// 分成结算金额重算
function caculate_sum_money(_this) {
var pay_money = $(_this).parent().parent().find(".pay_amount").text();
var ratio = $(_this).parent().parent().find(".ratio").val();
//比例金额
if (!ratio || ratio < 0) {
ratio = 0;
$(_this).parent().parent().find(".ratio").val(ratio);
} else if (ratio > 100) {
ratio = 100;
$(_this).parent().parent().find(".ratio").val(ratio);
}
//退款
var refund = $(_this).parent().parent().find(".refund").val();
if (!refund || refund < 0) {
refund = 0;
$(_this).parent().parent().find(".refund").val(refund);
} else if(parseFloat(refund) > parseFloat(pay_money)) {
refund = pay_money;
$(_this).parent().parent().find(".refund").val(refund);
}
//退款
var withhold = $(_this).parent().parent().find(".withhold").val();
var oldwithhold = $(_this).parent().parent().find(".oldwithhold").val();
// console.log(withhold-oldwithhold);
if (!withhold ) {
withhold = 0;
$(_this).parent().parent().find(".withhold").val(withhold);
}
if (!oldwithhold ) {
oldwithhold = 0;
$(_this).parent().parent().find(".oldwithhold").val(oldwithhold);
}
// else if(parseFloat(withhold) > parseFloat(pay_money)) {
// withhold = pay_money;
// $(_this).parent().parent().find(".withhold").val(withhold);
// }
//补点
var increment_ratio = $(_this).parent().parent().find(".increment_ratio").val();
if (!increment_ratio || increment_ratio < 0) {
increment_ratio = 0;
$(_this).parent().parent().find(".increment_ratio").val(increment_ratio);
} else if(increment_ratio > 100) {
increment_ratio = 100;
$(_this).parent().parent().find(".increment_ratio").val(increment_ratio);
}
var week_amount_find = $(_this).parent().parent();
var old_amount = week_amount_find.find(".sum_money_span").text();
//扣款
pay_money = parseFloat(pay_money) - parseFloat(refund);
// var value = (parseFloat(pay_money)*(parseFloat(ratio)/100) + parseFloat(pay_money)*(parseFloat(increment_ratio)/100));
if (withdraw_type == 3) {
var value = parseFloat(pay_money)*(parseFloat(increment_ratio)/100);
} else {
var value = (parseFloat(pay_money)*(parseFloat(ratio)/100) + parseFloat(pay_money)*(parseFloat(increment_ratio)/100));
}
// var value = parseFloat(pay_money);
// console.log(value);
$(_this).parent().parent().find(".sum_money_span").text(value.toFixed(2));
$(_this).parent().parent().find(".sum_money").val(value.toFixed(2));
var this_amount = week_amount_find.find(".sum_money_span").text();
var week_amount = 0;
var i = 0;
for (;;) {
week_amount = week_amount_find.find(".week_amount").text();
i++;
// console.log(week_amount);
if (week_amount) {
break;
} else {
week_amount_find = week_amount_find.prev();
}
// if (i>10) {
// break;
// }
}
// console.log(old_amount);
// console.log(this_amount);
// console.log(week_amount);
var D_value = parseFloat(old_amount) - parseFloat(this_amount) + parseFloat(withhold-oldwithhold);
// console.log(D_value);
week_amount_find.find(".week_amount").text((parseFloat(week_amount) - D_value).toFixed(2));
$(_this).parent().parent().find(".oldwithhold").val(withhold)
}
//结算金额重算
function changeStatementAmount(_this) {
var _parent = $(_this).parent().parent();
var statement_amount = '';
var num = 0;
for (;;) {
statement_amount = _parent.find(".statement_money").text();
if (!statement_amount ) {
_parent = _parent.prev();
} else {
break;
}
num++;
// if (num>10) {
// break;
// }
}
var row = _parent.find(".statement_money").attr("rowspan");
var get_item = _parent;
var sum_amount = 0;
for (var i =0;i<parseInt(row);i++) {
var amount = get_item.find(".week_amount").text();
if (amount) {
sum_amount = parseFloat(sum_amount) + parseFloat(amount);
get_item = get_item.next();
} else {
get_item = get_item.next();
}
}
// console.log(sum_amount);
_parent.find(".statement_money").text(sum_amount.toFixed(2));
}
//结算金额合计重算
function changeSumAmount() {
var sum_amount = 0;
var st = 0;
$("#statementShow").find(".statement_money").each(function (key,val) {
st = $(val).data('st')
sum_amount = parseFloat(sum_amount) + parseFloat($(val).text());
});
$(".count_sum_money").text(sum_amount.toFixed(2));
}
</script>
</html>

@ -166,19 +166,42 @@
<td rowspan="{$com['statement_info'][0]['time_row']}">{$com['statement_info'][0]['time']}</td>
<!-- <td>{$com['statement_info'][0]['game_list'][0]['statement_begin_time']}-{$com['statement_info'][0]['game_list'][0]['statement_end_time']}</td>-->
<td><span class="pay_amount">{$com['statement_info'][0]['game_list'][0]['pay_amount']}</span></td>
<td><input class="refund" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$com['statement_info'][0]['game_list'][0]['refund']|default=0}" style="width: 40px;" name="refund[{$com['id']}][{$com['statement_info'][0]['game_list'][0]['game_name']}{$com['statement_info'][0]['time']}{$com['statement_info'][0]['account']}]"></td>
<td><input class="ratio" onkeyup ="if(value>100){value=100}else{value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')}if(value.indexOf(0)==0){value=0}" name="ratio[{$com['id']}][{$com['statement_info'][0]['game_list'][0]['game_name']}{$com['statement_info'][0]['time']}{$com['statement_info'][0]['account']}]" value="{$com['statement_info'][0]['game_list'][0]['ratio']}" style="width: 25px;">%</td>
<td><input class="increment_ratio" onkeyup ="if(value>100){value=100}else{value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')}if(value.indexOf(0)==0){value=0}" name="increment_ratio[{$com['id']}][{$com['statement_info'][0]['game_list'][0]['game_name']}{$com['statement_info'][0]['time']}{$com['statement_info'][0]['account']}]" value="{$com['statement_info'][0]['game_list'][0]['increment_ratio']}" style="width: 25px;">%</td>
<td>
<if condition="($com.is_reward_fine_split eq 0)">
<input class="refund" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$com['statement_info'][0]['game_list'][0]['refund']|default=0}" style="width: 40px;" name="refund[{$com['id']}][{$com['statement_info'][0]['game_list'][0]['game_name']}{$com['statement_info'][0]['time']}{$com['statement_info'][0]['account']}]">
<else/>
0
</if>
</td>
<td>
<if condition="($com.is_reward_fine_split eq 0)">
<input class="ratio" onkeyup ="if(value>100){value=100}else{value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')}if(value.indexOf(0)==0){value=0}" name="ratio[{$com['id']}][{$com['statement_info'][0]['game_list'][0]['game_name']}{$com['statement_info'][0]['time']}{$com['statement_info'][0]['account']}]" value="{$com['statement_info'][0]['game_list'][0]['ratio']}" style="width: 25px;">%
<else/>
0%
</if>
</td>
<td>
<if condition="($com.is_reward_fine_split eq 0)">
<input class="increment_ratio" onkeyup ="if(value>100){value=100}else{value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')}if(value.indexOf(0)==0){value=0}" name="increment_ratio[{$com['id']}][{$com['statement_info'][0]['game_list'][0]['game_name']}{$com['statement_info'][0]['time']}{$com['statement_info'][0]['account']}]" value="{$com['statement_info'][0]['game_list'][0]['increment_ratio']}" style="width: 25px;">%
<else/>
0%
</if>
</td>
<td><span class="sum_money_span">{$com['statement_info'][0]['game_list'][0]['sum_money']}</span>
<input class="sum_money" name="sum_money[{$com['id']}][{$com['statement_info'][0]['game_list'][0]['game_name']}{$com['statement_info'][0]['time']}{$com['statement_info'][0]['account']}]" value="{$com['statement_info'][0]['game_list'][0]['sum_money']}" style="width: 20px;display: none">
<input class="st" name="st[{$com['id']}][{$com['statement_info'][0]['game_list'][0]['game_name']}{$com['statement_info'][0]['time']}{$com['statement_info'][0]['account']}]" value="{$com['st']}" style="width: 20px;display: none"></td>
<input class="st" name="st[{$com['id']}][{$com['statement_info'][0]['game_list'][0]['game_name']}{$com['statement_info'][0]['time']}{$com['statement_info'][0]['account']}]" value="{$com['st']}" style="width: 20px;display: none">
</td>
<!-- <td rowspan="{$com['statement_info'][0]['time_row']}">{$com['reward']}</td>-->
<!-- <td rowspan="{$com['statement_info'][0]['time_row']}">{$com['fine']}</td>-->
<td rowspan="{$com['statement_info'][0]['time_row']}">{$com['statement_info'][0]['reward']||default="0"}</td>
<td rowspan="{$com['statement_info'][0]['time_row']}">{$com['statement_info'][0]['fine']||default="0"}</td>
<td rowspan="{$com['statement_info'][0]['time_row']}">{$com['statement_info'][0]['game_list'][0]['reward']||default="0"}</td>
<td rowspan="{$com['statement_info'][0]['time_row']}">{$com['statement_info'][0]['game_list'][0]['fine']||default="0"}</td>
<td rowspan="{$com['statement_info'][0]['time_row']}">
<input class="withhold" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$com['statement_info'][0]['withhold_amount']|default=0}" style="width: 40px;" name="withhold[{$com['id']}][{$com['statement_info'][0]['game_list'][0]['game_name']}{$com['statement_info'][0]['time']}{$com['statement_info'][0]['account']}][{$com['statement_info'][0]['game_list'][0]['statement_begin_time']}]">
<input class="oldwithhold" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$com['statement_info'][0]['withhold_amount']|default=0}" style="width: 40px;display: none" >
<if condition="($com.is_reward_fine_split eq 0)">
<input class="withhold" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$com['statement_info'][0]['withhold_amount']|default=0}" style="width: 40px;" name="withhold[{$com['id']}][{$com['statement_info'][0]['game_list'][0]['game_name']}{$com['statement_info'][0]['time']}{$com['statement_info'][0]['account']}][{$com['statement_info'][0]['game_list'][0]['statement_begin_time']}]">
<input class="oldwithhold" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$com['statement_info'][0]['withhold_amount']|default=0}" style="width: 40px;display: none" >
<else/>
0
</if>
</td>
<td rowspan="{$com['statement_info'][0]['time_row']}"><span class="week_amount">{$com['statement_info'][0]['week_amount']}</span><input style="display: none" class="week_amount_input" value="{$com['statement_info'][0]['week_amount']}"></td>
<td rowspan="{$com.row}" data-st="{$com['st']}" class="statement_money">{$com['statement_money']}</td>
@ -215,9 +238,12 @@
<if condition="!$is_export">
<td rowspan="{$com.row}">
<if condition="($com['st'] eq 1 ) AND ($pool_status lt 1)">
<if condition="($com['st'] eq 1 ) AND ($pool_status lt 1) AND ($com.is_reward_fine_split eq 0)">
<a data-id="{$com['id']}" class='butn no_statement' style="cursor:pointer">不结算</a>
</if>
<if condition="($pool_status lt 1) AND ($com.is_reward_fine_split eq 0)">
<a data-id="{$com['id']}" data-st="{$com['st']}" class='butn split_RewardOrFail' style="cursor:pointer">奖惩分离</a>
</if>
</td>
</if>
@ -231,9 +257,27 @@
<td>{$game['game_type_name']}</td>
<!-- <td>{$game['statement_begin_time']}-{$game['statement_end_time']}</td>-->
<td><span class="pay_amount">{$game['pay_amount']}</span></td>
<td><input class="refund" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$game['refund']|default=0}" style="width: 40px;" name="refund[{$com['id']}][{$game['game_name']}{$com['statement_info'][0]['time']}{$com['statement_info'][0]['account']}]"></td>
<td><input class="ratio" onkeyup ="if(value>100){value=100}else{value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')}if(value.indexOf(0)==0){value=0}" name="ratio[{$com['id']}][{$game['game_name']}{$com['statement_info'][0]['time']}{$com['statement_info'][0]['account']}]" value="{$game['ratio']}" style="width: 25px;">%</td>
<td><input class="increment_ratio" onkeyup ="if(value>100){value=100}else{value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')}if(value.indexOf(0)==0){value=0}" name="increment_ratio[{$com['id']}][{$game['game_name']}{$com['statement_info'][0]['time']}{$com['statement_info'][0]['account']}]" value="{$game['increment_ratio']}" style="width: 25px;">%</td>
<td>
<if condition="($com.is_reward_fine_split eq 0)">
<input class="refund" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$game['refund']|default=0}" style="width: 40px;" name="refund[{$com['id']}][{$game['game_name']}{$com['statement_info'][0]['time']}{$com['statement_info'][0]['account']}]">
<else/>
0
</if>
</td>
<td>
<if condition="($com.is_reward_fine_split eq 0)">
<input class="ratio" onkeyup ="if(value>100){value=100}else{value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')}if(value.indexOf(0)==0){value=0}" name="ratio[{$com['id']}][{$game['game_name']}{$com['statement_info'][0]['time']}{$com['statement_info'][0]['account']}]" value="{$game['ratio']}" style="width: 25px;">%
<else/>
0%
</if>
</td>
<td>
<if condition="($com.is_reward_fine_split eq 0)">
<input class="increment_ratio" onkeyup ="if(value>100){value=100}else{value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')}if(value.indexOf(0)==0){value=0}" name="increment_ratio[{$com['id']}][{$game['game_name']}{$com['statement_info'][0]['time']}{$com['statement_info'][0]['account']}]" value="{$game['increment_ratio']}" style="width: 25px;">%
<else/>
0%
</if>
</td>
<td>
<span class="sum_money_span">{$game['sum_money']}</span><input class="sum_money" name="sum_money[{$com['id']}][{$game['game_name']}{$com['statement_info'][0]['time']}{$com['statement_info'][0]['account']}]" value="{$game['sum_money']}" style="width: 20px;display: none">
<input class="st" name="st[{$com['id']}][{$game['game_name']}{$com['statement_info'][0]['time']}{$com['statement_info'][0]['account']}]" value="{$com['st']}" style="width: 20px;display: none"></td>
@ -264,9 +308,27 @@
<td><span class="pay_amount">{$account['game_list'][0]['pay_amount']}</span></td>
<!-- <td>{$account['game_list'][0]['ratio']|showNumPercent}</td>-->
<!-- <td>{$account['game_list'][0]['increment_ratio']|showNumPercent}</td>-->
<td><input class="refund" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$account['game_list'][0]['refund']|default=0}" style="width: 40px;" name="refund[{$com['id']}][{$account['game_list'][0]['game_name']}{$account['time']?$account['time']:$com['statement_info'][0]['time']}{$account['account']}]"></td>
<td><input class="ratio" onkeyup ="if(value>100){value=100}else{value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')}if(value.indexOf(0)==0){value=0}" name="ratio[{$com['id']}][{$account['game_list'][0]['game_name']}{$account['time']?$account['time']:$com['statement_info'][0]['time']}{$account['account']}]" value="{$account['game_list'][0]['ratio']}" style="width: 25px;">%</td>
<td><input class="increment_ratio" onkeyup ="if(value>100){value=100}else{value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')}if(value.indexOf(0)==0){value=0}" name="increment_ratio[{$com['id']}][{$account['game_list'][0]['game_name']}{$account['time']?$account['time']:$com['statement_info'][0]['time']}{$account['account']}]" value="{$account['game_list'][0]['increment_ratio']}" style="width: 25px;">%</td>
<td>
<if condition="($com.is_reward_fine_split eq 0)">
<input class="refund" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$account['game_list'][0]['refund']|default=0}" style="width: 40px;" name="refund[{$com['id']}][{$account['game_list'][0]['game_name']}{$account['time']?$account['time']:$com['statement_info'][0]['time']}{$account['account']}]">
<else/>
0
</if>
</td>
<td>
<if condition="($com.is_reward_fine_split eq 0)">
<input class="ratio" onkeyup ="if(value>100){value=100}else{value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')}if(value.indexOf(0)==0){value=0}" name="ratio[{$com['id']}][{$account['game_list'][0]['game_name']}{$account['time']?$account['time']:$com['statement_info'][0]['time']}{$account['account']}]" value="{$account['game_list'][0]['ratio']}" style="width: 25px;">%
<else/>
0%
</if>
</td>
<td>
<if condition="($com.is_reward_fine_split eq 0)">
<input class="increment_ratio" onkeyup ="if(value>100){value=100}else{value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')}if(value.indexOf(0)==0){value=0}" name="increment_ratio[{$com['id']}][{$account['game_list'][0]['game_name']}{$account['time']?$account['time']:$com['statement_info'][0]['time']}{$account['account']}]" value="{$account['game_list'][0]['increment_ratio']}" style="width: 25px;">%
<else/>
0%
</if>
</td>
<td>
<span class="sum_money_span">{$account['game_list'][0]['sum_money']}</span>
<input class="sum_money" name="sum_money[{$com['id']}][{$account['game_list'][0]['game_name']}{$account['time']?$account['time']:$com['statement_info'][0]['time']}{$account['account']}]" value="{$account['game_list'][0]['sum_money']}" style="width: 20px;display: none">
@ -280,8 +342,12 @@
<notempty name="account['time']">
<td rowspan="{$account['time_row']}">
<input class="withhold" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$account['withhold_amount']|default=0}" style="width: 40px;" name="withhold[{$com['id']}][{$account['game_list'][0]['game_name']}{$account['time']}{$account['account']}][{$account['game_list'][0]['statement_begin_time']}]">
<input class="oldwithhold" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$account['withhold_amount']|default=0}" style="width: 40px;display: none">
<if condition="($com.is_reward_fine_split eq 0)">
<input class="withhold" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$account['withhold_amount']|default=0}" style="width: 40px;" name="withhold[{$com['id']}][{$account['game_list'][0]['game_name']}{$account['time']}{$account['account']}][{$account['game_list'][0]['statement_begin_time']}]">
<input class="oldwithhold" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$account['withhold_amount']|default=0}" style="width: 40px;display: none">
<else/>
0
</if>
</td>
<td rowspan="{$account['time_row']}"><span class="week_amount">{$account['week_amount']}</span><input style="display: none" class="week_amount_input" value="{$account['week_amount']}"></td>
</notempty>
@ -309,9 +375,27 @@
<td><span class="pay_amount">{$game['pay_amount']}</span></td>
<!-- <td>{$game['ratio']|showNumPercent}</td>-->
<!-- <td>{$game['increment_ratio']|showNumPercent}</td>-->
<td><input class="refund" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$game['refund']|default=0}" style="width: 40px;" name="refund[{$com['id']}][{$game['game_name']}{$account['time']?$account['time']:$com['statement_info'][0]['time']}{$account['account']}]"></td>
<td><input class="ratio" onkeyup ="if(value>100){value=100}else{value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')}if(value.indexOf(0)==0){value=0}" name="ratio[{$com['id']}][{$game['game_name']}{$account['time']?$account['time']:$com['statement_info'][0]['time']}{$account['account']}]" value="{$game['ratio']}" style="width: 25px;">%</td>
<td><input class="increment_ratio" onkeyup ="if(value>100){value=100}else{value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')}if(value.indexOf(0)==0){value=0}" name="increment_ratio[{$com['id']}][{$game['game_name']}{$account['time']?$account['time']:$com['statement_info'][0]['time']}{$account['account']}]" value="{$game['increment_ratio']}" style="width: 25px;">%</td>
<td>
<if condition="($com.is_reward_fine_split eq 0)">
<input class="refund" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$game['refund']|default=0}" style="width: 40px;" name="refund[{$com['id']}][{$game['game_name']}{$account['time']?$account['time']:$com['statement_info'][0]['time']}{$account['account']}]">
<else/>
0
</if>
</td>
<td>
<if condition="($com.is_reward_fine_split eq 0)">
<input class="ratio" onkeyup ="if(value>100){value=100}else{value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')}if(value.indexOf(0)==0){value=0}" name="ratio[{$com['id']}][{$game['game_name']}{$account['time']?$account['time']:$com['statement_info'][0]['time']}{$account['account']}]" value="{$game['ratio']}" style="width: 25px;">%
<else/>
0
</if>
</td>
<td>
<if condition="($com.is_reward_fine_split eq 0)">
<input class="increment_ratio" onkeyup ="if(value>100){value=100}else{value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')}if(value.indexOf(0)==0){value=0}" name="increment_ratio[{$com['id']}][{$game['game_name']}{$account['time']?$account['time']:$com['statement_info'][0]['time']}{$account['account']}]" value="{$game['increment_ratio']}" style="width: 25px;">%
<else/>
0
</if>
</td>
<td>
<span class="sum_money_span">{$game['sum_money']}</span><input class="sum_money" name="sum_money[{$com['id']}][{$game['game_name']}{$account['time']?$account['time']:$com['statement_info'][0]['time']}{$account['account']}]" value="{$game['sum_money']}" style="width: 20px;display: none">
<input class="st" name="st[{$com['id']}][{$game['game_name']}{$account['time']?$account['time']:$com['statement_info'][0]['time']}{$account['account']}]" value="{$com['st']}" style="width: 20px;display: none"></td>
@ -380,6 +464,34 @@
saveForm(id);
});
var pool_ids = "{$_GET['id']}";
$(".split_RewardOrFail").on("click",function() {
var id = $(this).data('id');
var st = $(this).data('st');
layer.confirm("是否确认对该数据进行奖惩分离", {title: false}, function (index) {
$.ajax({
type: "POST",
url: "{:U('splitRewardOrFailData')}",
dataType: 'json',
async: false,
data: {id: id, st: st, pool_id: pool_ids},
success: function (data) {
if (data.status == 1) {
layer.msg("<font style='color:white'>" + data.msg + "</font>");
setTimeout(function () {
window.location.reload();
}, 1500);
} else {
layer.msg("<font style='color:white'>" + data.msg + "</font>");
return false;
}
}
});
});
});
var return_data = "";
function saveForm(id) {
@ -560,9 +672,9 @@
} else {
week_amount_find = week_amount_find.prev();
}
if (i>10) {
break;
}
// if (i>10) {
// break;
// }
}
var D_value = parseFloat(old_amount)-parseFloat(this_amount) + parseFloat(withhold-oldwithhold);

@ -217,7 +217,7 @@
</div>
<else />
<div style="line-height: 2;">
<span <if condition="$data.verify_status eq 2 or $data.verify_status eq 3">class="unPayment"</if> data-id="{$data['id']}">{$data.payment}</span>
<span <if condition="$data.verify_status eq 2 or $data.verify_status eq 3">class="unPayment" style="color:blue"</if> data-id="{$data['id']}">{$data.payment}</span>
</div>
</if>
</td>

@ -103,6 +103,7 @@
<th rowspan="2" style="border-right: solid 1px #b6cad2;">产品</th>
<th rowspan="2" style="border-right: solid 1px #b6cad2;">平台流水</th>
<th rowspan="2" style="border-right: solid 1px #b6cad2;">未结算平台流水</th>
<th rowspan="2" style="border-right: solid 1px #b6cad2;">退款</th>
<th colspan=2 style="border-right: solid 1px #b6cad2;">分成比例</th>
@ -111,6 +112,8 @@
<th rowspan="2" style="border-right: solid 1px #b6cad2;">合作方待结算分成</th>
<th rowspan="2" style="border-right: solid 1px #b6cad2;">违规罚款</th>
<th rowspan="2" style="border-right: solid 1px #b6cad2;">奖励</th>
<th rowspan="2" style="border-right: solid 1px #b6cad2;">其他扣款</th>
<th rowspan="2" style="border-right: solid 1px #b6cad2;">周期结算金额</th>
<!-- <th rowspan="2" style="border-right: solid 1px #b6cad2;">周结算金额</th>-->
<th rowspan="2" style="border-right: solid 1px #b6cad2;">合作待结算金额</th>
@ -135,17 +138,23 @@
</tr>
</thead>
<tbody id="statementShow">
<if condition = "empty($data)">
<tr>
<td colspan="50" class="text-center">aOh! 暂时还没有内容!</td>
</tr>
</if>
<foreach name="data" item="com">
<tr>
<td rowspan="{$com.statement_count}">{$com.company_name}</td>
<td rowspan="{$com.statement_count}">{$com.matche_platform}</td>
<!-- <td rowspan="{$com.statement_count}">{$com.statement_begin_time} ~ {$com.statement_end_time}</td> -->
<!-- <td rowspan="{$com['statement_info'][0]['row']}">{$com['statement_info'][0]['time']}</td>-->
<td>{$com['statement_info'][0]['statement_begin_time']}-{$com['statement_info'][0]['statement_end_time']}</td>
<td rowspan="{$com['statement_info'][0]['row']}">{$com['statement_info'][0]['time']}</td>
<!-- <td>{$com['statement_info'][0]['statement_begin_time']}-{$com['statement_info'][0]['statement_end_time']}</td>-->
<td>{$com['statement_info'][0]['game_name']}</td>
<td>{$com['statement_info'][0]['pay_amount']}</td>
<td>{$com['statement_info'][0]['pay_amount']}</td>
<td >{$com['statement_info'][0]['refund']|default=0}</td>
<td>{$com['statement_info'][0]['ratio']|showNumPercent}</td>
<td>{$com['statement_info'][0]['company_ratio']|showNumPercent}</td>
<td>{$com['statement_info'][0]['promote_ratio']|showNumPercent}</td>
@ -154,6 +163,12 @@
<td rowspan="{$com.statement_count}">{$com['fine']-0}</td>
<td rowspan="{$com.statement_count}">{$com['reward']-0}</td>
<td rowspan="{$com['statement_info'][0]['row']}">
{$com['statement_info'][0]['withhold']|default=0}
</td>
<td rowspan="{$com['statement_info'][0]['row']}">
<span class="week_amount">{$com['statement_info'][0]['week_amount']}</span>
</td>
<!-- <td rowspan="{$com['statement_info'][0]['row']}">{$com['statement_info'][0]['week_amount']}</td>-->
<td rowspan="{$com.statement_count}">{$com['statement_money']}</td>
@ -177,7 +192,7 @@
<if condition="!$is_export">
<td rowspan="{$com.statement_count}">
<if condition="($com['st'] eq 1 ) AND ($pool_status lt 1)">
<if condition="($com['st'] eq 1 ) AND ($pool_status lt 1) AND ($com.is_reward_fine_split eq 0)">
<a data-id="{$com['id']}" class='butn no_statement' style="cursor:pointer">不结算</a>
</if>
</td>
@ -187,18 +202,29 @@
<foreach name="com.statement_info" item="it" key="k">
<if condition="$k neq 0">
<tr>
<td>{$it['statement_begin_time']}-{$it['statement_end_time']}</td>
<!-- <notempty name="it['time']">-->
<!-- <td rowspan="{$it['row']}">{$it['time']}</td>-->
<!-- </notempty>-->
<!-- <td>{$it['statement_begin_time']}-{$it['statement_end_time']}</td>-->
<notempty name="it['time']">
<td rowspan="{$it['row']}">{$it['time']}</td>
</notempty>
<td>{$it['game_name']}</td>
<td>{$it['pay_amount']}</td>
<td>{$it['pay_amount']}</td>
<td rowspan="{$it['row']}">
{$it['refund']|default=0}
</td>
<td>{$it['ratio']|showNumPercent}</td>
<td>{$it['company_ratio']|showNumPercent}</td>
<td>{$it['promote_ratio']|showNumPercent}</td>
<td>{$it['fax_ratio']|showNumPercent}</td>
<td>{$it['d_statement_money']}</td>
<notempty name="it['time']">
<td rowspan="{$it['row']}">{$it['fine']-0}</td>
<td rowspan="{$it['row']}">{$it['reward']-0}</td>
<td rowspan="{$it['row']}">
{$it['withhold']|default=0}
</td>
<td rowspan="{$it['row']}"><span class="week_amount">{$it['week_amount']}</span></td>
</notempty>
</tr>
</if>
@ -212,10 +238,13 @@
<td></td>
<td></td>
<td></td>
<td></td>
<td>{$count.d_statement_money}</td>
<td>{$count.fine}</td>
<td>{$count.reward}</td>
<td></td>
<td>{$count.statement_money}</td>
<td>{$count.statement_money_s}</td>
<td></td>
<td></td>
<td></td>
@ -228,7 +257,7 @@
</tr>
<if condition="$is_export">
<tr>
<td ></td>
<td >初审状态:</td>
<td>
<if condition="$pool_data.verify_status eq -3 ">
<div style="line-height: 2;color: red;">
@ -240,6 +269,9 @@
</div>
</if>
</td>
</tr>
<tr>
<td >审批状态:</td>
<td>
<if condition="$pool_data.verify_status eq -1 ">
<div style="line-height: 2;color: red;">
@ -251,6 +283,9 @@
</div>
</if>
</td>
</tr>
<tr>
<td >打款状态:</td>
<td>
<if condition="$pool_data.verify_status eq -2 ">
<div style="line-height: 2;color: red;">

@ -98,19 +98,21 @@
<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>
<!-- <th>结算日期</th>-->
<th>户名</th>
<th>帐号</th>
<th>开户行</th>
@ -124,23 +126,38 @@
</tr>
</thead>
<tbody id="statementShow">
<if condition = "empty($data)">
<tr>
<td colspan="50" class="text-center">aOh! 暂时还没有内容!</td>
</tr>
</if>
<foreach name="data" item="com">
<tr>
<td rowspan="{$com.statement_count}">{$key-0+1}</td>
<td rowspan="{$com.statement_count}">{$com.company_name}</td>
<!-- <td rowspan="{$com['statement_info'][0]['row']}">{$com['statement_info'][0]['time']}</td>-->
<td rowspan="{$com['statement_info'][0]['row']}">{$com['statement_info'][0]['time']}</td>
<td>{$com['statement_info'][0]['game_name']}</td>
<td>{$com['statement_info'][0]['pay_amount']}</td>
<td >{$com['statement_info'][0]['refund']|default=0}</td>
<td>{$com['statement_info'][0]['ratio']|showNumPercent}</td>
<td>{$com['statement_info'][0]['increment_ratio']|showNumPercent}</td>
<td>{$com['statement_info'][0]['fax_ratio']|showNumPercent}</td>
<td>{$com['statement_info'][0]['d_statement_money']}</td>
<td rowspan="{$com.statement_count}">{$com['fine']-0}</td>
<td rowspan="{$com.statement_count}">{$com['reward']-0}</td>
<!-- <td rowspan="{$com.statement_count}">{$com['fine']-0}</td>-->
<!-- <td rowspan="{$com.statement_count}">{$com['reward']-0}</td>-->
<td rowspan="{$com['statement_info'][0]['row']}">{$com['statement_info'][0]['fine']-0}</td>
<td rowspan="{$com['statement_info'][0]['row']}">{$com['statement_info'][0]['reward']-0}</td>
<td rowspan="{$com['statement_info'][0]['row']}">
{$com['statement_info'][0]['withhold']|default=0}
</td>
<td rowspan="{$com['statement_info'][0]['row']}">
<span class="week_amount">{$com['statement_info'][0]['week_amount']}</span>
</td>
<!-- <td rowspan="{$com['statement_info'][0]['row']}">{$com['statement_info'][0]['week_amount']}</td>-->
<td rowspan="{$com.statement_count}">{$com['statement_money']}</td>
<td rowspan="{$com.statement_count}">{$com.settlement_contact}</td>
<td>{$com['statement_info'][0]['statement_begin_time']}-{$com['statement_info'][0]['statement_end_time']}</td>
<!-- <td rowspan="{$com['statement_info'][0]['row']}">{$com['statement_info'][0]['time']}</td>-->
<if condition="$com['is_payment'] eq 2">
@ -157,11 +174,11 @@
<td rowspan="{$com.statement_count}"><if condition="$com['is_payment'] eq 1"><else /></if></td>
<td rowspan="{$com.statement_count}"><if condition="$com['st'] eq 0"><else /></if></td>
<td rowspan="{$com.statement_count}">{$com.renark}</td>
<td rowspan="{$com.statement_count}">{$com.remark}</td>
<if condition="!$is_export">
<td rowspan="{$com.statement_count}">
<if condition="($com['st'] eq 1 ) AND ($pool_status lt 1)">
<if condition="($com['st'] eq 1 ) AND ($pool_status lt 1) AND ($com.is_reward_fine_split eq 0)">
<a data-id="{$com['id']}" class='butn no_statement' style="cursor:pointer">不结算</a>
</if>
</td>
@ -171,14 +188,28 @@
<foreach name="com.statement_info" item="it" key="k">
<if condition="$k neq 0">
<tr>
<notempty name="it['time']">
<td rowspan="{$it['row']}">{$it['time']}</td>
</notempty>
<td>{$it['game_name']}</td>
<td>{$it['pay_amount']}</td>
<td rowspan="{$it['row']}">
{$it['refund']|default=0}
</td>
<td>{$it['ratio']|showNumPercent}</td>
<td>{$it['increment_ratio']|showNumPercent}</td>
<td>{$it['fax_ratio']|showNumPercent}</td>
<td>{$it['d_statement_money']}</td>
<td>{$it['statement_begin_time']}-{$it['statement_end_time']}</td>
<notempty name="it['time']">
<td rowspan="{$it['row']}">{$it['fine']-0}</td>
<td rowspan="{$it['row']}">{$it['reward']-0}</td>
<td rowspan="{$it['row']}">
{$it['withhold']|default=0}
</td>
<td rowspan="{$it['row']}"><span class="week_amount">{$it['week_amount']}</span></td>
</notempty>
<!-- <td>{$it['statement_begin_time']}-{$it['statement_end_time']}</td>-->
<!-- <notempty name="it['time']">-->
<!-- <td rowspan="{$it['row']}">{$it['week_amount']}</td>-->
<!-- </notempty>-->
@ -190,18 +221,17 @@
</foreach>
</foreach>
<tr>
<td colspan=3 >合计:</td>
<td colspan=4 >合计:</td>
<td>{$count.platform_amount}</td>
<td></td>
<td></td>
<td></td>
<td></td><td></td>
<td>{$count.d_statement_money}</td>
<td>{$count.fine}</td>
<td>{$count.reward}</td>
<td>{$count.statement_money}</td>
<!-- <td>{$count.statement_money}</td>-->
<td></td>
<td></td>
<td>{$count.statement_money}</td>
<td>{$count.statement_money_s}</td>
<td></td>
<td></td>
<td></td>
@ -215,7 +245,7 @@
</tr>
<if condition="$is_export">
<tr>
<td ></td>
<td >初审状态:</td>
<td>
<if condition="$pool_data.verify_status eq -3 ">
<div style="line-height: 2;color: red;">
@ -227,6 +257,9 @@
</div>
</if>
</td>
</tr>
<tr>
<td >审批状态:</td>
<td>
<if condition="$pool_data.verify_status eq -1 ">
<div style="line-height: 2;color: red;">
@ -238,6 +271,9 @@
</div>
</if>
</td>
</tr>
<tr>
<td >打款状态:</td>
<td>
<if condition="$pool_data.verify_status eq -2 ">
<div style="line-height: 2;color: red;">

@ -137,7 +137,11 @@
</tr>
</thead>
<tbody id="statementShow">
<if condition = "empty($data)">
<tr>
<td colspan="50" class="text-center">aOh! 暂时还没有内容!</td>
</tr>
</if>
<foreach name="data" item="com">
<tr>
<td rowspan="{$com.row}">{$key-0+1}</td>
@ -169,8 +173,8 @@
<td>{$com['statement_info'][0]['game_list'][0]['increment_ratio']}%</td>
<td><span class="sum_money_span">{$com['statement_info'][0]['game_list'][0]['sum_money']}</span></td>
<td rowspan="{$com['statement_info'][0]['time_row']}">{$com['statement_info'][0]['reward']||default="0"}</td>
<td rowspan="{$com['statement_info'][0]['time_row']}">{$com['statement_info'][0]['fine']||default="0"}</td>
<td rowspan="{$com['statement_info'][0]['time_row']}">{$com['statement_info'][0]['game_list'][0]['reward']||default="0"}</td>
<td rowspan="{$com['statement_info'][0]['time_row']}">{$com['statement_info'][0]['game_list'][0]['fine']||default="0"}</td>
<td rowspan="{$com['statement_info'][0]['time_row']}">{$com['statement_info'][0]['game_list'][0]['withhold']|default=0}</td>
<td rowspan="{$com['statement_info'][0]['time_row']}">{$com['statement_info'][0]['week_amount']||default="0"}</td>
<td rowspan="{$com.row}">{$com['statement_money']}</td>
@ -207,7 +211,7 @@
<if condition="!$is_export">
<td rowspan="{$com.row}">
<if condition="($com['st'] eq 1 ) AND ($pool_status lt 1)">
<if condition="($com['st'] eq 1 ) AND ($pool_status lt 1) AND ($com.is_reward_fine_split eq 0)">
<a data-id="{$com['id']}" class='butn no_statement' style="cursor:pointer">不结算</a>
</if>
</td>
@ -363,7 +367,7 @@
<if condition="$is_export">
<tr>
<td ></td>
<td >初审状态:</td>
<td>
<if condition="$pool_data.verify_status eq -3 ">
<div style="line-height: 2;color: red;">
@ -375,6 +379,9 @@
</div>
</if>
</td>
</tr>
<tr>
<td >审批状态:</td>
<td>
<if condition="$pool_data.verify_status eq -1 ">
<div style="line-height: 2;color: red;">
@ -386,6 +393,9 @@
</div>
</if>
</td>
</tr>
<tr>
<td >打款状态:</td>
<td>
<if condition="$pool_data.verify_status eq -2 ">
<div style="line-height: 2;color: red;">

@ -194,6 +194,7 @@
<th><input class="check-all" type="checkbox"></th>
<th>时间</th>
<th>市场专员</th>
<th>离职时间</th>
<th>级别</th>
<th><div class="tooltip">开发总流水<span class="tooltiptext"><span style="margin-left: -10px">当月自主开发下渠道游戏内充值总和</span></span></div></th>
<th><div class="tooltip">维护总流水<span class="tooltiptext"><span style="margin-left: -10px">当月只维护下渠道游戏内充值总和</span></span></div></th>
@ -222,6 +223,7 @@
<td><input class="ids" type="checkbox" value="{$data['id']} "data-coefficient_check="{$data['coefficient_check']}" data-market_check="{$data['market_check']}" data-finance_check="{$data['finance_check']}" name="ids[]"></td>
<td>{$data.pay_time|default='无'}</td>
<td>{$data.real_name|default='无'}</td>
<td>{$data.leave_time|default='--'}</td>
<td>{$data.level|default='无'}</td>
<td><a href="{:U('FinancePromote/index',array('time_start'=>$data['start_time'],'time_end'=>$data['end_time'],'admin_id'=>$data['admin_id'],'develop_type'=>'1'))}" >{$data.performance_revenue|default='0.00'}</a></td>

@ -37,6 +37,15 @@ class LeavePercentageFactory
}
public function returnUnSettlementList() {
if (!self::$arrUnSettlementList) {
$this->unSettlementList();
}
return self::$arrUnSettlementList;
}
/**
* 判断是否结算绩效
* @param string $date

@ -2788,4 +2788,7 @@ ADD COLUMN `sociaty_level` tinyint(2) NOT NULL DEFAULT 0 COMMENT '公会等级 1
ALTER TABLE `sys_ucenter_member`
ADD COLUMN `apply_leave_time` int(11) NOT NULL DEFAULT 0 COMMENT '申请离职时间' AFTER `work_status`,
ADD COLUMN `leave_time` int(11) NOT NULL DEFAULT 0 COMMENT '离职时间' AFTER `apply_leave_time`;
ADD COLUMN `leave_time` int(11) NOT NULL DEFAULT 0 COMMENT '离职时间' AFTER `apply_leave_time`;
ALTER TABLE `tab_company_statement_info`
ADD COLUMN `is_reward_fine_split` tinyint(255) NULL DEFAULT 0 COMMENT '是否是奖罚分离生成 0 否 1 是' AFTER `pay_check_time`;
Loading…
Cancel
Save