优化下游结算与导出

master
chenzhi 4 years ago
parent 84a665a2ab
commit b74b5ecfad

@ -248,33 +248,50 @@ class CompanyStatementPoolController extends ThinkController
} }
$cline = $line+1; $cline = $line+1;
if($is_export){ if($is_export){
$v['sum_money_exp'] = "="; $v['statement_money'] = "=";
} }
$row = 0;
foreach($v['statement_info'] as $ke=>&$va){ foreach($v['statement_info'] as $ke=>&$va){
$line ++; $va['row'] = count($va['game_list']);
if(isset($va['ratio'])){ $row += count($va['game_list']);
$va['increment_ratio'] = 0;
}else{ foreach($va['game_list'] as $key=>&$val){
$va['ratio'] = 0; $line ++;
} if(isset($val['ratio'])){
$val['increment_ratio'] = 0;
if($is_export){
//J3*(K3+L3)+M3-N3
if($va['statement_type'] > 0){ //罚款服务器费用
$va['sum_money'] = "=J{$line}";
}else{ }else{
$va['sum_money'] = "=J{$line}*(K{$line}+L{$line})+M{$line}-N{$line}"; $val['ratio'] = 0;
}
if($is_export){
$val['sum_money'] = "=J{$line}*(K{$line}+L{$line})";
$v['statement_money'] .= "M{$line}+";
}else{
$count['platform_amount'] += $val['pay_amount'];
$count['sum_money'] += $val['sum_money'];
} }
}else{
$count['platform_amount'] += $va['pay_amount'];
$count['sum_money'] += $va['sum_money'];
} }
// if($is_export){
// //J3*(K3+L3)+M3-N3
// if($va['statement_type'] > 0){ //罚款服务器费用
// $va['sum_money'] = "=J{$line}";
// }else{
// $va['sum_money'] = "=J{$line}*(K{$line}+L{$line})+M{$line}-N{$line}";
// }
// }else{
// $count['platform_amount'] += $va['pay_amount'];
// $count['sum_money'] += $va['sum_money'];
// }
}
$v['row'] = $row;
if($is_export){
$v['statement_money'] .="N{$cline}-O{$cline}";
} }
$v['statement_count'] = count($v['statement_info']);
} }
if($is_export){ if($is_export){
$count["platform_amount"] = "=SUM(J2:J".$line.")"; $count["platform_amount"] = "=SUM(J2:J".$line.")";
$count["sum_money"] = "=SUM(O2:O".$line.")"; $count["sum_money"] = "=SUM(P2:P".$line.")";
} }
$this->assign("data",$infolist); $this->assign("data",$infolist);
$this->assign("count",$count); $this->assign("count",$count);

@ -83,7 +83,10 @@
float: left; float: left;
margin: 0; margin: 0;
} }
#statementShow td{
line-height: 1.5;
padding: 8px 0;
}
</style> </style>
<body> <body>
<!-- <div style="width: 100%;line-height: 100px;font-size: 25px;font-weight: 600;text-align: center;"> <!-- <div style="width: 100%;line-height: 100px;font-size: 25px;font-weight: 600;text-align: center;">
@ -108,6 +111,7 @@
<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>
@ -119,109 +123,160 @@
<th>是否结算</th> <th>是否结算</th>
<th>备注</th> <th>备注</th>
<if condition="!$is_export"> <if condition="!$is_export">
<th>操作</th> <th>操作</th>
</if> </if>
</tr> </tr>
</thead> </thead>
<tbody id="statementShow"> <tbody id="statementShow">
<foreach name="data" item="com"> <foreach name="data" item="com">
<tr> <tr>
<td rowspan="{$com.statement_count}">{$key-0+1}</td> <td rowspan="{$com.row}">{$key-0+1}</td>
<td rowspan="{$com.statement_count}">{$com.company_name}</td> <td rowspan="{$com.row}">{$com.company_name}</td>
<td rowspan="{$com.statement_count}">{$com.company_info.account}</td> <!-- <td rowspan="{$com.statement_count}">{$com.company_info.account}</td> -->
<td rowspan="{$com.statement_count}">{$com.company_info.company_relation_str}</td>
<td rowspan="{$com.statement_count}">{$com.company_info.nickname}</td>
<td rowspan="{$com.statement_count}">{$com.company_info.company_type_str}</td>
<td>{$com['statement_info'][0]['game_name']}</td> <notempty name="com['statement_info']">
<td>{$com['statement_info'][0]['game_type_name']}</td> <td rowspan="{$com['statement_info'][0]['row']}">{$com['statement_info'][0]['account']}</td>
<td>{$com['statement_info'][0]['statement_begin_time']}-{$com['statement_info'][0]['statement_end_time']}</td>
<td>{$com['statement_info'][0]['pay_amount']}</td>
<if condition="$com['statement_info'][0]['statement_type'] neq 0">
<td></td>
<td></td>
<else /> <else />
<td>{$com['statement_info'][0]['ratio']|default=0}%</td> <td>-</td>
<td>{$com['statement_info'][0]['increment_ratio']|default=0}%</td> </notempty>
</if>
<td rowspan="{$com.row}">{$com.company_info.company_relation_str}</td>
<td rowspan="{$com.row}">{$com.company_info.nickname}</td>
<td rowspan="{$com.row}">{$com.company_info.company_type_str}</td>
<td>{$com['statement_info'][0]['reward']}</td> <notempty name="com['statement_info'][0]['game_list']">
<td>{$com['statement_info'][0]['fine']}</td> <td>{$com['statement_info'][0]['game_list'][0]['game_name']}</td>
<td>{$com['statement_info'][0]['sum_money']}</td> <td>{$com['statement_info'][0]['game_list'][0]['game_type_name']}</td>
<td>{$com['statement_info'][0]['game_list'][0]['statement_begin_time']}-{$com['statement_info'][0]['game_list'][0]['statement_end_time']}</td>
<td>{$com['statement_info'][0]['game_list'][0]['pay_amount']}</td>
<td>{$com['statement_info'][0]['game_list'][0]['ratio']|default=0}%</td>
<td>{$com['statement_info'][0]['game_list'][0]['increment_ratio']|default=0}%</td>
<td>{$com['statement_info'][0]['game_list'][0]['sum_money']}</td>
<td rowspan="{$com.row}">{$com['reward']}</td>
<td rowspan="{$com.row}">{$com['fine']}</td>
<td rowspan="{$com.row}">{$com['statement_money']}</td>
<else />
<td>-</td>
<td>-</td>
<td>-</td>
<td>-</td>
<td>-</td>
<td>-</td>
<td>-</td>
<td rowspan="{$com.row}">-</td>
<td rowspan="{$com.row}">-</td>
<td rowspan="{$com.row}">-</td>
</notempty>
<if condition="$com['is_payment'] eq 2"> <if condition="$com['is_payment'] eq 2">
<td rowspan="{$com.statement_count}">{$com.company_info.payee_name}</td> <td rowspan="{$com.row}">{$com.company_info.payee_name}</td>
<td rowspan="{$com.statement_count}">&nbsp;{$com.company_info.bank_account}</td> <td rowspan="{$com.row}">&nbsp;{$com.company_info.bank_account}</td>
<td rowspan="{$com.statement_count}">{$com.company_info.opening_bank}</td> <td rowspan="{$com.row}">{$com.company_info.opening_bank}</td>
</if> </if>
<if condition="$com['is_payment'] eq 1"> <if condition="$com['is_payment'] eq 1">
<td rowspan="{$com.statement_count}">{$com.company_info.ali_user}</td> <td rowspan="{$com.row}">{$com.company_info.ali_user}</td>
<td rowspan="{$com.statement_count}">{$com.company_info.ali_account}</td> <td rowspan="{$com.row}">{$com.company_info.ali_account}</td>
<td rowspan="{$com.statement_count}"></td> <td rowspan="{$com.row}"></td>
</if> </if>
<td rowspan="{$com.row}"><if condition="$com['is_payment'] eq 1"><else /></if></td>
<td rowspan="{$com.row}"><if condition="$com['st'] eq 0"><else /></if></td>
<td rowspan="{$com.row}">{$com.remark}</td>
<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.remark}</td>
<if condition="!$is_export"> <if condition="!$is_export">
<td rowspan="{$com.statement_count}"> <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)">
<a data-id="{$com['id']}" class='butn no_statement' style="cursor:pointer">不结算</a> <a data-id="{$com['id']}" class='butn no_statement' style="cursor:pointer">不结算</a>
</if> </if>
</td> </td>
</if> </if>
</tr> </tr>
<foreach name="com.statement_info" item="it" key="k"> <if condition="$com['statement_info'][0]['row'] gt 1">
<if condition="$k neq 0"> <foreach name="com['statement_info'][0]['game_list']" item="game" key="gamekey">
<tr> <if condition="$gamekey gt 0">
<td>{$it['game_name']}</td> <tr>
<td>{$it['game_type_name']}</td> <td>{$game['game_name']}</td>
<td>{$it['statement_begin_time']}-{$it['statement_end_time']}</td> <td>{$game['game_type_name']}</td>
<td>{$it['pay_amount']}</td> <td>{$game['statement_begin_time']}-{$game['statement_end_time']}</td>
<td>{$game['pay_amount']}</td>
<td>{$game['ratio']|default=0}%</td>
<td>{$game['increment_ratio']|default=0}%</td>
<td>{$game['sum_money']}</td>
</tr>
</if>
</foreach>
</if>
<notempty name="com['statement_info'][1]">
<foreach name="com['statement_info']" item="account" key="akey">
<if condition="$akey gt 0">
<tr>
<td rowspan="{$account['row']}">{$account['account']}</td>
<notempty name="account['game_list']">
<td>{$account['game_list'][0]['game_name']}</td>
<td>{$account['game_list'][0]['game_type_name']}</td>
<td>{$account['game_list'][0]['statement_begin_time']}-{$account['game_list'][0]['statement_end_time']}</td>
<td>{$account['game_list'][0]['pay_amount']}</td>
<td>{$account['game_list'][0]['ratio']|default=0}%</td>
<td>{$account['game_list'][0]['increment_ratio']|default=0}%</td>
<td>{$account['game_list'][0]['sum_money']}</td>
<else />
<td>-</td>
<td>-</td>
<td>-</td>
<td>-</td>
<td>-</td>
<td>-</td>
<td>-</td>
</notempty>
</tr>
<if condition="$it['statement_type'] neq 0"> <if condition="$account['row'] gt 1">
<td></td> <foreach name="account['game_list']" item="game" key="gamekey">
<td></td> <if condition="$gamekey gt 0">
<else /> <tr>
<td>{$it['ratio']|default=0}%</td> <td>{$game['game_name']}</td>
<td>{$it['increment_ratio']|default=0}%</td> <td>{$game['game_type_name']}</td>
<td>{$game['statement_begin_time']}-{$game['statement_end_time']}</td>
<td>{$game['pay_amount']}</td>
<td>{$game['ratio']|default=0}%</td>
<td>{$game['increment_ratio']|default=0}%</td>
<td>{$game['sum_money']}</td>
</tr>
</if>
</foreach>
</if> </if>
<td>{$it['reward']}</td> </if>
<td>{$it['fine']}</td> </foreach>
<td>{$it['sum_money']}</td>
</tr> </notempty>
</if>
</foreach>
</foreach> </foreach>
<tr> <tr>
<td colspan=9 >合计:</td> <td colspan=9 >合计:</td>
<td>{$count.platform_amount|default=0}</td> <td>{$count.platform_amount}</td>
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td>{$count.sum_money|default=0}</td> <td></td>
<td>{$count.sum_money}</td>
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<if condition="!$is_export">
<td></td>
</if>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -237,26 +292,5 @@
}); });
}); });
</if> </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;
}
}
});
})
</script> </script>
</html> </html>

@ -0,0 +1,262 @@
<!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="__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="">
<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>
<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_count}">{$com.company_info.account}</td>
<td rowspan="{$com.statement_count}">{$com.company_info.company_relation_str}</td>
<td rowspan="{$com.statement_count}">{$com.company_info.nickname}</td>
<td rowspan="{$com.statement_count}">{$com.company_info.company_type_str}</td>
<td>{$com['statement_info'][0]['game_name']}</td>
<td>{$com['statement_info'][0]['game_type_name']}</td>
<td>{$com['statement_info'][0]['statement_begin_time']}-{$com['statement_info'][0]['statement_end_time']}</td>
<td>{$com['statement_info'][0]['pay_amount']}</td>
<if condition="$com['statement_info'][0]['statement_type'] neq 0">
<td></td>
<td></td>
<else />
<td>{$com['statement_info'][0]['ratio']|default=0}%</td>
<td>{$com['statement_info'][0]['increment_ratio']|default=0}%</td>
</if>
<td>{$com['statement_info'][0]['reward']}</td>
<td>{$com['statement_info'][0]['fine']}</td>
<td>{$com['statement_info'][0]['sum_money']}</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}">{$com.remark}</td>
<if condition="!$is_export">
<td rowspan="{$com.statement_count}">
<if condition="($com['st'] eq 1 ) AND ($pool_status lt 1)">
<a data-id="{$com['id']}" class='butn no_statement' 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['game_name']}</td>
<td>{$it['game_type_name']}</td>
<td>{$it['statement_begin_time']}-{$it['statement_end_time']}</td>
<td>{$it['pay_amount']}</td>
<if condition="$it['statement_type'] neq 0">
<td></td>
<td></td>
<else />
<td>{$it['ratio']|default=0}%</td>
<td>{$it['increment_ratio']|default=0}%</td>
</if>
<td>{$it['reward']}</td>
<td>{$it['fine']}</td>
<td>{$it['sum_money']}</td>
</tr>
</if>
</foreach>
</foreach>
<tr>
<td colspan=9 >合计:</td>
<td>{$count.platform_amount|default=0}</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>{$count.sum_money|default=0}</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<if condition="!$is_export">
<td></td>
</if>
</tr>
</tbody>
</table>
</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;
}
}
});
})
</script>
</html>
Loading…
Cancel
Save