|
|
|
@ -222,6 +222,103 @@ class CompanyStatementPoolController extends ThinkController
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function editPool() {
|
|
|
|
|
if(!isset($_REQUEST['id'])){
|
|
|
|
|
$this->error('参数错误');
|
|
|
|
|
}
|
|
|
|
|
$id = $_REQUEST['id'];
|
|
|
|
|
$is_export= false;
|
|
|
|
|
if (isset($_REQUEST['export']) && $_REQUEST['export']==1){
|
|
|
|
|
$is_export = true;
|
|
|
|
|
}
|
|
|
|
|
//获取基本信息
|
|
|
|
|
$infolist = M("company_statement_info","tab_")->field("*,'1' as st")->where("pool_id = '{$id}'")->select();
|
|
|
|
|
//获取母单
|
|
|
|
|
$pool_info = M("company_statement_pool","tab_")->field('statement_num,create_lack_ids,verify_status,is_payment,withdraw_type')->where("id={$id}")->find();
|
|
|
|
|
if(!empty($pool_info['create_lack_ids'])){
|
|
|
|
|
$l_ids = $pool_info['create_lack_ids'];
|
|
|
|
|
$lack_info = M("company_lack_statement_info","tab_")->field("*,'0' as st")->where("id in ({$l_ids})")->select();
|
|
|
|
|
$infolist =array_merge($infolist,$lack_info);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$statement_num = $pool_info['statement_num'];
|
|
|
|
|
$this->assign("title",$statement_num);
|
|
|
|
|
$this->assign("pool_status",$pool_info['verify_status']);
|
|
|
|
|
$this->assign("is_payment",$pool_info['is_payment']);
|
|
|
|
|
|
|
|
|
|
$this->editPuPool($infolist,$is_export);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function editPuPool(&$infolist,$is_export) {
|
|
|
|
|
$line = 1;
|
|
|
|
|
$count = [];
|
|
|
|
|
//获取对接人
|
|
|
|
|
foreach($infolist as $k=>&$v){
|
|
|
|
|
$v['statement_info'] = json_decode($v['statement_info'],true);
|
|
|
|
|
$v['company_info'] = json_decode($v['company_info'],true);
|
|
|
|
|
$v['statement_begin_time'] = date('Y.m.d',$v['statement_begin_time']);
|
|
|
|
|
$v['statement_end_time'] = date('Y.m.d',$v['statement_end_time']);
|
|
|
|
|
if( isset($v['verify_status'])){
|
|
|
|
|
if( $v['verify_status'] ==2 ){
|
|
|
|
|
$v['is_payment'] = 2; //不打款
|
|
|
|
|
}else{
|
|
|
|
|
$v['is_payment'] = 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
$cline = $line+1;
|
|
|
|
|
if($is_export){
|
|
|
|
|
$v['statement_money'] = "=ROUND(";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$row = 0;
|
|
|
|
|
foreach($v['statement_info'] as $ke=>&$va){
|
|
|
|
|
$va['row'] = count($va['game_list']);
|
|
|
|
|
$row += count($va['game_list']);
|
|
|
|
|
|
|
|
|
|
foreach($va['game_list'] as $key=>&$val){
|
|
|
|
|
$line ++;
|
|
|
|
|
if($v['withdraw_type'] != 3) {
|
|
|
|
|
if(isset($val['ratio'])){
|
|
|
|
|
$val['increment_ratio'] = 0;
|
|
|
|
|
}else{
|
|
|
|
|
$val['ratio'] = 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if($is_export){
|
|
|
|
|
if($v['withdraw_type'] != 3) {
|
|
|
|
|
$val['sum_money'] = "=ROUND(K{$line}*(L{$line}+M{$line}),2)";
|
|
|
|
|
} else {
|
|
|
|
|
$val['sum_money'] = "=ROUND(K{$line}*(M{$line}),2)";
|
|
|
|
|
}
|
|
|
|
|
$v['statement_money'] .= "N{$line}+";
|
|
|
|
|
}else{
|
|
|
|
|
$count['platform_amount'] += $val['pay_amount'];
|
|
|
|
|
$count['sum_money'] += $val['sum_money'];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
$v['row'] = $row;
|
|
|
|
|
if($is_export){
|
|
|
|
|
if($v['withdraw_type'] != 3) {
|
|
|
|
|
$v['statement_money'] .="O{$cline}-P{$cline},2)";
|
|
|
|
|
} else {
|
|
|
|
|
$v['statement_money'] = substr($v['statement_money'],0,strlen($v['statement_money'])-1).",2)";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if($is_export){
|
|
|
|
|
$count["platform_amount"] = "=ROUND(SUM(K2:K".$line."),2)";
|
|
|
|
|
$count["sum_money"] = "=ROUND(SUM(Q2:Q".$line."),2)";
|
|
|
|
|
}
|
|
|
|
|
$this->assign("data",$infolist);
|
|
|
|
|
$this->assign("count",$count);
|
|
|
|
|
$this->assign("is_export",$is_export);
|
|
|
|
|
$this->display("CompanyStatementPool/editPuPool");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//个人汇总结算查看
|
|
|
|
|
public function viewPuPool(&$infolist,$is_export){
|
|
|
|
|
$line = 1;
|
|
|
|
@ -972,6 +1069,8 @@ class CompanyStatementPoolController extends ThinkController
|
|
|
|
|
$opBtn = [
|
|
|
|
|
"viewPool"=>"<a class='confirm viewPool' data-id='{$id}'>查看</a>",
|
|
|
|
|
|
|
|
|
|
"editPool"=>"<a class='confirm editPool' data-id='{$id}'>编辑</a>",
|
|
|
|
|
|
|
|
|
|
"addRemark"=>"<a class='confirm addRemark' data-id='{$id}'>新增备注</a>",
|
|
|
|
|
"editRemark"=>"<a class='confirm editRemark' data-remark='{$remark}' data-id='{$id}'>修改备注</a>",
|
|
|
|
|
"viewRemark"=>"<a class='confirm viewRemark' data-remark='{$remark}' data-id='{$id}'>查看备注</a>",
|
|
|
|
@ -996,7 +1095,7 @@ class CompanyStatementPoolController extends ThinkController
|
|
|
|
|
case '-2':
|
|
|
|
|
case '-1':
|
|
|
|
|
case '0':
|
|
|
|
|
$optist = ["viewPool","reCount","cancelPool"];
|
|
|
|
|
$optist = ["viewPool","reCount","cancelPool","editPool"];
|
|
|
|
|
break;
|
|
|
|
|
case '1':
|
|
|
|
|
$optist = ["viewPool","addRemark","viewRemark","editRemark","viewVoucher","editVoucher","uploadVoucher","setPayment","setUlPayment"];
|
|
|
|
|