Merge pull request '1.28功能提交' (#100) from feature/add_item into release

Reviewed-on: http://8.136.139.249:3000/wmtx/platform/pulls/100
master
郑永星 4 years ago
commit 6c1c82b649

@ -67,6 +67,7 @@ class CompanyStatementOfflineController extends ThinkController
->alias("c")
->field("c.*,p.statement_num,p.verify_status")
->where($map)
->where(['p.verify_status'=>['neq',6]])
->join("tab_company_statement_pool as p ON c.pool_id = p.id")

@ -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;
}
}
/**
* 获取公司奖罚
*/

@ -5654,6 +5654,7 @@ class ExportController extends Controller
$xlsCell = array(
array('uid','账号ID'),
array('nickname','管理员账号'),
array('real_name','真实姓名'),
array('group_name','角色类型'),
array('login','登录次数'),
array('last_login_time','最后登录时间'),
@ -5666,6 +5667,11 @@ class ExportController extends Controller
}else{
$map['nickname'] = array('like', '%'.(string)$nickname.'%');
}
if(isset($_REQUEST['real_name'])) {
$map['real_name'] = $_REQUEST['real_name'];
}
if(isset($_REQUEST['status'])){
$map['status'] = $_REQUEST['status'];
}

@ -3,6 +3,7 @@
namespace Admin\Controller;
use User\Api\UserApi as UserApi;
use Base\Factory\BaseFactory;
/**
* 后台首页控制器
@ -12,6 +13,9 @@ class MarketPercentageController extends ThinkController
{
protected $coefficient = [];
//实例化离职服务类
private $leavePercentage;
private $unSettlementList;
protected function _initialize()
{
@ -23,6 +27,13 @@ class MarketPercentageController extends ThinkController
$this->coefficient[$value['pay_time']][$value['admin_id']] = $value['coefficient'] / 100;
}
$instance = BaseFactory::getInstance();
$this->leavePercentage = $instance->factoryClass("LeavePercentage");
//不结算列表
$this->leavePercentage->unSettlementList();
$this->unSettlementList = $this->leavePercentage->returnUnSettlementList();
parent::_initialize();
}
@ -582,28 +593,28 @@ class MarketPercentageController extends ThinkController
if (is_administrator() || session('user_group_id') == 15 || session('user_group_id') == 14 || session('user_group_id') == 19 || session('user_group_id') == 23) {
unset($map['admin_id']);
$markerData = M("ucenter_member")->field("id")->where(['work_status' => 1])->select();
if ($markerData) {
$admin_map['sys_member.uid'] = ['not in', array_column($markerData, 'id')];
}
// $markerData = M("ucenter_member")->field("id")->where(['work_status' => 1])->select();
//
// if ($markerData) {
// $admin_map['sys_member.uid'] = ['not in', array_column($markerData, 'id')];
// }
$admin_data = M("member")
->field("access.uid admin_id")
->join("left join sys_auth_group_access access on sys_member.uid = access.uid")
->join("left join sys_auth_group auth on access.group_id=auth.id")
->where(['group_id' => ['in', '11,12,21']])
->where($admin_map)
// ->where($admin_map)
->select();
if ($admin_data) {
$map['admin_id'] = ['in', array_column($admin_data, 'admin_id')];
}
if (!in_array($_REQUEST['admin_id'], array_column($markerData, 'id'))) {
// if (!in_array($_REQUEST['admin_id'], array_column($markerData, 'id'))) {
$_REQUEST['admin_id'] ? ($map['admin_id'] = $_REQUEST['admin_id']) : '';
} else {
$this->display("marketstaffsettle");
die();
}
// } else {
// $this->display("marketstaffsettle");
// die();
// }
}
@ -737,6 +748,12 @@ class MarketPercentageController extends ThinkController
continue;
}
}
// 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']));
@ -1172,6 +1189,8 @@ class MarketPercentageController extends ThinkController
$value['company_profit'] = "0.00";
}
!($this->leavePercentage->isSettlement($value['pay_time'],$value['admin_id']))?$data[$key]['achievement_bonus']=0:'';
$data[$key]['coefficient'] = $this->coefficient[$value['pay_time']][$value['admin_id']] ? $this->coefficient[$value['pay_time']][$value['admin_id']] : 1;
$data[$key]['wait_commission'] =
@ -1409,15 +1428,16 @@ class MarketPercentageController extends ThinkController
$data = SM("market_altogether", "tab_")
->field("max(tab_market_altogether.pay_time) pay_time,tab_market_altogether.real_name,tab_market_altogether.admin_id,tab_market_altogether.nickname,level,sum(pay_amount) pay_amount,sum(extend_commission) extend_commission,
sum(performance_commission) performance_commission,sum(achievement_bonus* IF(coefficient is not NULL, coefficient, 100)/100) achievement_bonus,
sum(performance_commission) performance_commission,IF(leave_time!=0 and unix_timestamp(now())-leave_time>86400*30,0,sum(achievement_bonus* IF(coefficient is not NULL, coefficient, 100)/100)) achievement_bonus,
sum(wait_performance_commission)+sum(wait_achievement_commission) wait_amount,
sum(if(status > 0, wait_performance_commission, '0.00')) + sum(if(status > 0, wait_achievement_commission,'0.00') * IF(coefficient is not NULL, coefficient, 100)/100 ) wait_extend_commission,
sum(if(status = 0, wait_performance_commission, '0.00')) + round(sum(if(status = 0, wait_achievement_commission,'0.00') * IF(coefficient is not NULL, coefficient, 100)/100),2) wait_commission, remark,status")
sum(if(tab_market_altogether.status > 0, wait_performance_commission, '0.00')) + sum(if(tab_market_altogether.status > 0, wait_achievement_commission,'0.00') * IF(coefficient is not NULL, coefficient, 100)/100 ) wait_extend_commission,
sum(if(tab_market_altogether.status = 0, wait_performance_commission, '0.00')) + round(sum(if(tab_market_altogether.status = 0, wait_achievement_commission,'0.00') * IF(coefficient is not NULL, coefficient, 100)/100),2) wait_commission, remark,tab_market_altogether.status")
->where($map);
if ($_REQUEST['export']) {
$data = $data
->join("left join tab_coefficient on tab_market_altogether.admin_id=tab_coefficient.admin_id and tab_coefficient.pay_time=tab_market_altogether.pay_time")
->join("left join sys_ucenter_member on tab_market_altogether.admin_id=sys_ucenter_member.id")
->order("tab_market_altogether.pay_time DESC,company_profit DESC")
->group("tab_market_altogether.admin_id,tab_market_altogether.pay_time")
->select(false);
@ -1425,6 +1445,7 @@ class MarketPercentageController extends ThinkController
$data = $data
// ->page($p, $row)
->join("left join tab_coefficient on tab_market_altogether.admin_id=tab_coefficient.admin_id and tab_coefficient.pay_time=tab_market_altogether.pay_time")
->join("left join sys_ucenter_member on tab_market_altogether.admin_id=sys_ucenter_member.id")
->order("tab_market_altogether.pay_time DESC,company_profit DESC")
->group("tab_market_altogether.admin_id,tab_market_altogether.pay_time")
->select(false);

@ -10,6 +10,7 @@
namespace Admin\Controller;
use User\Api\UserApi as UserApi;
use function GuzzleHttp\Psr7\str;
use Base\Factory\BaseFactory;
/**
* 后台首页控制器
@ -1545,4 +1546,13 @@ class TimingController extends AdminController {
}
//离职定时器
public function timingleaveMarketMember() {
$instance = BaseFactory::getInstance();
$leavePercentageInstance = $instance->factoryClass("LeavePercentage");
$leavePercentageInstance->leaveTiming();
}
}

@ -31,6 +31,11 @@ class UserController extends AdminController
if (isset($_REQUEST['status'])) {
$map['status'] = $_REQUEST['status'];
}
if(isset($_REQUEST['real_name'])) {
$map['real_name'] = $_REQUEST['real_name'];
}
if (is_numeric($nickname)) {
$map['uid|nickname'] = array(intval($nickname), array('like', '%' . $nickname . '%'), '_multi' => true);
} else {
@ -389,6 +394,22 @@ class UserController extends AdminController
}
}
if (strtotime($_POST['apply_leave_time'])<time()) {
$this->error('申请离职时间不能早于当前时间!');
}
if (strtotime($_POST['leave_time'])<time()) {
$this->error('离职时间不能早于当前时间!');
}
if (strtotime($_POST['apply_leave_time'])>strtotime($_POST['leave_time'])) {
$this->error('申请离职时间不得晚于离职时间!');
}
if ((strtotime($_POST['apply_leave_time'])&&!strtotime($_POST['leave_time']))||!strtotime($_POST['apply_leave_time'])&&strtotime($_POST['leave_time'])) {
$this->error('申请离职时,申请离职时间与离职时间都必须填写!');
}
$group = M('auth_group', 'sys_')->where(['id' => I('auth')])->find();
if (is_null($group)) {
$this->error('角色类型不存在!');
@ -430,6 +451,8 @@ class UserController extends AdminController
$info['second_pwd'] = (empty($spwd) || $spwd == $oldspwd) ? $oldspwd : $spwd;
$info['email'] = $_POST['email'];
$info['mobile'] = isset($_POST['mobile']) ? $_POST['mobile'] : '';
$_POST['apply_leave_time'] ? ($info['apply_leave_time'] = strtotime($_POST['apply_leave_time'])):'';
$_POST['leave_time'] ? ($info['leave_time'] = strtotime($_POST['leave_time'])+86399):'';
if($_POST['work_status']) {
$info['work_status'] = $_POST['work_status'];
}
@ -463,6 +486,9 @@ class UserController extends AdminController
$map['id'] = $_GET['id'];
$Member = D('UcenterMember')->where($map)->find();
$Member['apply_leave_time']?($Member['apply_leave_time'] = date("Y-m-d",$Member['apply_leave_time'])):($Member['apply_leave_time']='');
$Member['leave_time']?($Member['leave_time'] = date("Y-m-d",$Member['leave_time'])):($Member['leave_time']='');
$data = D('Member')->where(array('uid' => $_GET['id']))->find();
$au = D('AuthGroupAccess')->where(array('uid' => $_GET['id']))->find();

@ -86,7 +86,7 @@ class ModelModel extends Model{
return empty($fields) ? '' : json_encode($fields);
}
protected function getAttribute($fields) {
protected function getAttribute($fields="") {
return empty($fields) ? '' : implode(',', $fields);
}

@ -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;">
{$data.payment}
<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>
@ -306,6 +306,19 @@
});
});
$(".unPayment").click(function () {
var id = $(this).data("id");
var url = "{:U('viewUnPaymentPool')}"+"&id="+id
layer.open({
type: 2,
title: "海南万盟天下科技有限公司",
shadeClose: true,
shade: 0.8,
area: ['100%', '100%'],
content: url
});
});
$(".editPool").click(function () {
var id = $(this).data("id");
var url = "{:U('editPool')}"+"&id="+id

@ -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>
@ -226,6 +255,51 @@
<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>
</tr>
<tr>
<td >审批状态:</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>
</tr>
<tr>
<td >打款状态:</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>

@ -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>
@ -213,6 +243,51 @@
<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>
</tr>
<tr>
<td >审批状态:</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>
</tr>
<tr>
<td >打款状态:</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>
</div>

@ -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>
@ -361,7 +365,51 @@
</tr>
</if>
<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>
</tr>
<tr>
<td >审批状态:</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>
</tr>
<tr>
<td >打款状态:</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>

@ -148,6 +148,7 @@ text-indent:0;
</th>
<th>游戏ID</th>
<th>游戏名称</th>
<th>归属识别号</th>
<th>运营平台</th>
<th>混服管理</th>
<th>游戏类型</th>
@ -173,6 +174,7 @@ text-indent:0;
<td><input class="ids" type="checkbox" value="{$data['id']}" name="ids[]"></td>
<td>{$data.id}</td>
<td>{$data.game_name}</td>
<td>{$data.unique_code|default="无"}</td>
<td class="">{:get_systems_name($data['sdk_version'])}</td>
<td>{:getServerType($data['server_type'])}</td>

@ -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>

@ -68,17 +68,29 @@
<!-- </if>-->
</td>
</tr>
<tr>
<td class="l">申请离职时间:</td>
<td class="r">
<input type="text" id="apply_leave_time" name="apply_leave_time" class="" value="{$list['apply_leave_time']}" placeholder="申请离职时间" autocomplete="off"/>
</td>
</tr>
<tr>
<td class="l">离职时间:</td>
<td class="r">
<input type="text" id="leave_time" name="leave_time" class="" value="{$list['leave_time']}" placeholder="离职时间" autocomplete="off"/>
</td>
</tr>
<tr>
<td class="l noticeinfo">离职状态</td>
<td class="r table_radio table_radio2">
<span class="table_btn">
<label>
<input type="radio" class="inp_radio" value="1" name="work_status" <if condition="$list['work_status'] eq 1"> checked</if>> 离职
<input disabled type="radio" class="inp_radio" value="1" name="work_status" <if condition="$list['work_status'] eq 1"> checked</if>> 离职
</label>
<label>
<input type="radio" class="inp_radio" value="0" name="work_status" <if condition="$list['work_status'] eq 0"> checked</if> > 未离职
<input disabled type="radio" class="inp_radio" value="0" name="work_status" <if condition="$list['work_status'] eq 0"> checked</if> > 未离职
</label></span>
<span class="notice-text" style="line-height:1.4;width:68%;">离职状态,市场专员离职发放后自动标志未离职</span>
<!-- <span class="notice-text" style="line-height:1.4;width:68%;">离职状态,市场专员离职发放后自动标志未离职</span>-->
</td>
</tr>
@ -119,6 +131,11 @@
<script src="__STATIC__/layer/layer.js" type="text/javascript"></script>
<script type="text/javascript" src="__STATIC__/layer/extend/layer.ext.js" ></script>
<script src="__STATIC__/jquery.cookie.js" charset="utf-8"></script>
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<php>if(C('COLOR_STYLE')=='blue_color') echo '<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">';</php>
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
<div class="common_settings">
@ -134,6 +151,29 @@
<block name="script">
<script>
$('#apply_leave_time').datetimepicker({
format: 'yyyy-mm-dd',
language: "zh-CN",
showMeridian:true,
pickDate:true,
minView: 2,
autoclose: true,
pickTime:true,
todayBtn:true,
});
$('#leave_time').datetimepicker({
format: 'yyyy-mm-dd',
language: "zh-CN",
showMeridian:true,
pickDate:true,
minView: 2,
autoclose: true,
pickTime:true,
todayBtn:true,
});
$bind_wx=$("#bind_wx").prop('checked');
if($bind_wx){
cpsw=check(1);

@ -22,6 +22,9 @@
<div class="sleft">
<input type="text" name="nickname" class="" value="{:I('nickname')}" placeholder="管理员账号">
</div>
<div class="sleft">
<input type="text" name="real_name" class="" value="{:I('real_name')}" placeholder="真实姓名">
</div>
<div class="sleft">
<select name="status">
<option value="">状态</option>
@ -42,6 +45,7 @@
<th class="">账号ID</th>
<th class="">管理员账号</th>
<th class="">真实姓名</th>
<th class="">角色类型</th>
<th class="">登录次数</th>
<th class="">最后登录时间</th>
@ -56,6 +60,7 @@
<tr>
<td>{$vo.uid} </td>
<td>{$vo.nickname}</td>
<td>{$vo.real_name}</td>
<td>
{:get_auth_group_name($vo['uid'])}
</td>

@ -0,0 +1,45 @@
<?php
namespace Base\Factory;
use Base\Factory\LeavePercentageFactory;
class BaseFactory {
private static $instance ;
private $suffix = "Factory";
public $classes = [
'LeavePercentageFactory' => LeavePercentageFactory::class,
];
public function __construct()
{
}
//获取实例化接口
static function getInstance() {
if (!(self::$instance instanceof self)) {
self::$instance = new self();
}
return self::$instance;
}
//工厂类返回实例化类
public function factoryClass($name = '') {
if (!$name) {
return false;
}
$className = "{$name}{$this->suffix}";
if ($this->classes[$className]) {
return (new $this->classes[$className]);
} else {
return false;
}
}
}

@ -0,0 +1,106 @@
<?php
namespace base\Factory;
class LeavePercentageFactory
{
// private $isLeave = [0=>''];
private $model;
static $arrUnSettlementList = [];
public function __construct()
{
$this->model = M("ucenter_member");
}
/**
* 不结算的管理员列表
* @return array
*/
public function unSettlementList() {
if (self::$arrUnSettlementList) {
return;
}
$data = $this->model ->where(['work_status'=>1])->select();
$returnData = [];
foreach ($data as $key => $value) {
$returnData[$value['id']] = $value['leave_time'];
}
self::$arrUnSettlementList = $returnData;
}
public function returnUnSettlementList() {
if (!self::$arrUnSettlementList) {
$this->unSettlementList();
}
return self::$arrUnSettlementList;
}
/**
* 判断是否结算绩效
* @param string $date
* @param int $admin_id
* @return bool
*/
public function isSettlement($date = '',$admin_id= 0) {
//未离职结算
if (!isset(self::$arrUnSettlementList[$admin_id])) {
return true;
}
//判断往后日期都不结算
if (self::$arrUnSettlementList[$admin_id]
&&date("Y-m",self::$arrUnSettlementList[$admin_id])!=$date
&&strtotime($date)>self::$arrUnSettlementList[$admin_id]) {
return false;
}
//当月离职时间在职时间小于30天不结算
if (self::$arrUnSettlementList[$admin_id]
&&date("Y-m",self::$arrUnSettlementList[$admin_id])==$date
&&(strtotime(date("Y-m-t",strtotime($date)))-self::$arrUnSettlementList[$admin_id])<86400*30) {
return false;
}
return true;
}
/**
* 离职定时器方法
*/
public function leaveTiming() {
$memberData = $this->model->where(['leave_time'=>['gt',0],"work_status"=>0])->select();
$where = [];
foreach ($memberData as $key => $value) {
//判断离职时间是否已经达到
if (time() >= $value['leave_time']) {
array_push($where,$value['id']);
}
}
//离职时间达到列表
if($where) {
$this->model
->where(['id'=>['in',$where]])
->save(['work_status'=>1]);
}
}
}

@ -2784,4 +2784,11 @@ ADD COLUMN `apply_admin_id` int(11) NOT NULL DEFAULT 0 COMMENT '申請管理員I
ALTER TABLE `tab_society_info`
ADD COLUMN `sociaty_level` tinyint(2) NOT NULL DEFAULT 0 COMMENT '公会等级 1S 2A 3B 4其他 ' AFTER `create_account`;
ADD COLUMN `sociaty_level` tinyint(2) NOT NULL DEFAULT 0 COMMENT '公会等级 1S 2A 3B 4其他 ' AFTER `create_account`;
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`;
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