Merge branch 'feature/finance_statement_three' of wmtx/platform into master

优化结算
master
廖金灵 5 years ago committed by Gogs
commit db4fc9699c

@ -1873,7 +1873,6 @@ function excelUpStreamTemplate($data, $all_sum_money, $all_pay_amount, $big_all_
define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />'); define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
date_default_timezone_set('Europe/London');
Vendor("PHPExcel.PHPExcel"); Vendor("PHPExcel.PHPExcel");
$objReader = \PHPExcel_IOFactory::createReader('Excel5'); $objReader = \PHPExcel_IOFactory::createReader('Excel5');
@ -1898,11 +1897,12 @@ function excelUpStreamTemplate($data, $all_sum_money, $all_pay_amount, $big_all_
$objPHPExcel->getActiveSheet()->setCellValue('C7', "支付给:".$data['receive_company']['partner']); //增加支付给对应公司 $objPHPExcel->getActiveSheet()->setCellValue('C7', "支付给:".$data['receive_company']['partner']); //增加支付给对应公司
$line = 10; $line = 10;
//记录统计项目 //记录统计项目
$pay_amount_str = "="; $pay_amount_str = "=SUM(J10:";
$plat_amount_str = "=SUM(E10:";
//增加结算记录 //增加结算记录
foreach ($data['statement_info'] as $key => $value) { foreach ($data['statement_info'] as $key => $value) {
$objPHPExcel->getActiveSheet()->insertNewRowBefore($line,1)->mergeCells("J$line:K$line"); $objPHPExcel->getActiveSheet()->insertNewRowBefore($line,1)->mergeCells("J$line:K$line");
$objPHPExcel->getActiveSheet()->setCellValue('C'.$line, $value['statement_begin_time'] . '-' . $value['statement_end_time']); $objPHPExcel->getActiveSheet()->setCellValue('C'.$line, $value['statement_begin_time'].'-'.$value['statement_end_time']);
if ($value['statement_type'] > 0) {//罚款 if ($value['statement_type'] > 0) {//罚款
$product_name = $value['game_name']; $product_name = $value['game_name'];
$objPHPExcel->getActiveSheet()->setCellValue('F'.$line , '-'); $objPHPExcel->getActiveSheet()->setCellValue('F'.$line , '-');
@ -1918,6 +1918,23 @@ function excelUpStreamTemplate($data, $all_sum_money, $all_pay_amount, $big_all_
} }
} else {//游戏 } else {//游戏
$product_name = $value['game_name']; $product_name = $value['game_name'];
$objPHPExcel->getActiveSheet()->getStyle('F'.$line)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_PERCENTAGE);
$objPHPExcel->getActiveSheet()->getStyle('G'.$line)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_PERCENTAGE);
$objPHPExcel->getActiveSheet()->getStyle('H'.$line)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_PERCENTAGE);
$objPHPExcel->getActiveSheet()->getStyle('I'.$line)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_PERCENTAGE);
if($value['first_ratio'] == 0){
$value['first_ratio'] = 0;
}else{
$value['first_ratio'] = number_format($value['first_ratio']);
}
if($value['second_ratio'] == 0) {
$value['second_ratio'] = 0;
}else{
$value['second_ratio'] = number_format($value['second_ratio']);
}
if($value['promote_ratio'] == 0) $value['promote_ratio'] = 0;
if($value['fax_ratio'] == 0) $value['fax_ratio'] = 0;
$objPHPExcel->getActiveSheet()->setCellValue('F'.$line , $value['first_ratio'] . '%'); $objPHPExcel->getActiveSheet()->setCellValue('F'.$line , $value['first_ratio'] . '%');
$objPHPExcel->getActiveSheet()->setCellValue('G'.$line, $value['second_ratio'] . '%'); $objPHPExcel->getActiveSheet()->setCellValue('G'.$line, $value['second_ratio'] . '%');
$objPHPExcel->getActiveSheet()->setCellValue('H'.$line, $value['promote_ratio'] . '%'); $objPHPExcel->getActiveSheet()->setCellValue('H'.$line, $value['promote_ratio'] . '%');
@ -1930,16 +1947,16 @@ function excelUpStreamTemplate($data, $all_sum_money, $all_pay_amount, $big_all_
$objPHPExcel->getActiveSheet()->setCellValue('J'.$line, "=E{$line}*(1-H{$line})*F{$line}*(1-I{$line})"); $objPHPExcel->getActiveSheet()->setCellValue('J'.$line, "=E{$line}*(1-H{$line})*F{$line}*(1-I{$line})");
} }
} }
$pay_amount_str .= "J{$line}+";
$objPHPExcel->getActiveSheet()->setCellValue('D'.$line, $product_name); $objPHPExcel->getActiveSheet()->setCellValue('D'.$line, $product_name);
$line++; $line++;
} }
//合计 //合计
$objPHPExcel->getActiveSheet()->setCellValue("E" . ($line), $data['pay_amount']); $objPHPExcel->getActiveSheet()->setCellValue("E" . ($line), $plat_amount_str."E".($line-1).")");
// $objPHPExcel->getActiveSheet()->setCellValue("J" . ($line), $data['statement_money']); // $objPHPExcel->getActiveSheet()->setCellValue("J" . ($line), $data['statement_money']);
$objPHPExcel->getActiveSheet()->setCellValue("J" . ($line), trim($pay_amount_str,"+")); $objPHPExcel->getActiveSheet()->setCellValue("J" . ($line), $pay_amount_str."J".($line-1).")");
// $objPHPExcel->getActiveSheet()->setCellValue("J" . ($line+1), $big_all_sum_money); //本月分成总金额(人民币大写) // $objPHPExcel->getActiveSheet()->setCellValue("J" . ($line+1), $big_all_sum_money); //本月分成总金额(人民币大写)
$objPHPExcel->getActiveSheet()->setCellValue("J" . ($line+1), "=J{$line}"); //本月分成总金额(人民币大写) $objPHPExcel->getActiveSheet()->setCellValue("J" . ($line+1), "=J{$line}"); //本月分成总金额(人民币大写)
@ -1957,7 +1974,7 @@ function excelUpStreamTemplate($data, $all_sum_money, $all_pay_amount, $big_all_
$statement_begin_time = date('Y.m.d', $data['statement_begin_time']);//对账开始时间 $statement_begin_time = date('Y.m.d', $data['statement_begin_time']);//对账开始时间
$statement_end_time = date('Y.m.d',$data['statement_end_time']);//对账截止时间 $statement_end_time = date('Y.m.d',$data['statement_end_time']);//对账截止时间
$fileName = "{$data['second_party_info']['partner']}&{$data['first_party_info']['partner']}-对账单{$statement_begin_time}-{$statement_end_time}"; $fileName = "{$data['company_name']}&{$data['my_company']}-对账单{$statement_begin_time}-{$statement_end_time}";
ob_end_clean();//清除缓冲区,避免乱码 ob_end_clean();//清除缓冲区,避免乱码
header('pragma:public'); header('pragma:public');
@ -1996,12 +2013,13 @@ function excelDownStreamTemplate($data, $all_sum_money, $all_pay_amount, $big_al
$line = 3; $line = 3;
$pay_amount_str = "="; $pay_amount_str = "=SUM(F3:";
$plat_amount_str = "=SUM(C3:";
foreach ($data['statement_info'] as $key => $value) { foreach ($data['statement_info'] as $key => $value) {
$objPHPExcel->getActiveSheet()->insertNewRowBefore($line,1); $objPHPExcel->getActiveSheet()->insertNewRowBefore($line,1);
$objPHPExcel->getActiveSheet()->removeConditionalStyles(); $objPHPExcel->getActiveSheet()->removeConditionalStyles();
$objPHPExcel->getActiveSheet()->setCellValue('A'.$line, $value['statement_begin_time'] . '-' . $value['statement_end_time']); $objPHPExcel->getActiveSheet()->setCellValue('A'.$line, $value['statement_begin_time'].'-'.$value['statement_end_time']);
if ($value['statement_type'] > 0) {//罚款 if ($value['statement_type'] > 0) {//罚款
$product_name = $value['game_name']; $product_name = $value['game_name'];
$objPHPExcel->getActiveSheet()->setCellValue('D'.$line, '-'); $objPHPExcel->getActiveSheet()->setCellValue('D'.$line, '-');
@ -2015,6 +2033,24 @@ function excelDownStreamTemplate($data, $all_sum_money, $all_pay_amount, $big_al
} }
} else {//游戏 } else {//游戏
$product_name = $value['game_name']; $product_name = $value['game_name'];
$objPHPExcel->getActiveSheet()->getStyle('D'.$line)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_PERCENTAGE_00);
$objPHPExcel->getActiveSheet()->getStyle('E'.$line)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_PERCENTAGE_000);
$objPHPExcel->getActiveSheet()->getStyle('C'.$line)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER_00);
if($value['increment_ratio'] == 0){
$value['increment_ratio'] = 0;
}else{
$value['increment_ratio'] = number_format($value['first_ratio']);
}
if($value['ratio'] == 0) {
$value['ratio'] = 0;
}else{
$value['ratio'] = number_format($value['ratio']);
}
if($value['fax_ratio'] == 0) $value['fax_ratio'] = 0;
if ($data['withdraw_type'] == 2) { if ($data['withdraw_type'] == 2) {
$objPHPExcel->getActiveSheet()->setCellValue('D'.$line, $value['increment_ratio'] . '%'); $objPHPExcel->getActiveSheet()->setCellValue('D'.$line, $value['increment_ratio'] . '%');
}else{ }else{
@ -2026,12 +2062,11 @@ function excelDownStreamTemplate($data, $all_sum_money, $all_pay_amount, $big_al
$objPHPExcel->getActiveSheet()->setCellValue('F'.$line,"=C{$line}*D{$line}*(1-E{$line})"); $objPHPExcel->getActiveSheet()->setCellValue('F'.$line,"=C{$line}*D{$line}*(1-E{$line})");
} }
$objPHPExcel->getActiveSheet()->setCellValue('B'.$line, $product_name); $objPHPExcel->getActiveSheet()->setCellValue('B'.$line, $product_name);
$pay_amount_str .= "F{$line}+";
$line++; $line++;
} }
$objPHPExcel->getActiveSheet()->setCellValue('C'.($line), $data['pay_amount']);//合计-平台总额 $objPHPExcel->getActiveSheet()->setCellValue('C'.($line), $plat_amount_str."C".($line-1).")");//合计-平台总额
$objPHPExcel->getActiveSheet()->setCellValue('F'.($line), trim($pay_amount_str,"+"));//合计-结算金额 $objPHPExcel->getActiveSheet()->setCellValue('F'.($line), $pay_amount_str."F".($line-1).")");//合计-结算金额
// $objPHPExcel->getActiveSheet()->setCellValue('B'.($line+1), $big_all_sum_money);//大写支付结算金额 // $objPHPExcel->getActiveSheet()->setCellValue('B'.($line+1), $big_all_sum_money);//大写支付结算金额
@ -2053,7 +2088,7 @@ function excelDownStreamTemplate($data, $all_sum_money, $all_pay_amount, $big_al
$objPHPExcel->getActiveSheet()->setCellValue('E'.($line+9), $data['receive_company']['bank_account']."\t");//银行账号 $objPHPExcel->getActiveSheet()->setCellValue('E'.($line+9), $data['receive_company']['bank_account']."\t");//银行账号
$objPHPExcel->getActiveSheet()->setCellValue('E'.($line+10), $data['receive_company']['opening_bank']);//开户行 $objPHPExcel->getActiveSheet()->setCellValue('E'.($line+10), $data['receive_company']['opening_bank']);//开户行
$fileName = "{$data['second_party_info']['partner']}&{$data['first_party_info']['partner']}-对账单{$statement_begin_time}-{$statement_end_time}"; $fileName = "{$data['company_name']}&{$data['my_company']}-对账单{$statement_begin_time}-{$statement_end_time}";
// dd($fileName); // dd($fileName);
ob_end_clean();//清除缓冲区,避免乱码 ob_end_clean();//清除缓冲区,避免乱码
header('pragma:public'); header('pragma:public');

@ -1042,3 +1042,18 @@ function showPercent($num)
} }
function showNumPercent($num)
{
$num -= 0;
if($num >= 0){
if(strpos($num,"%")){
return $num;
}else{
return $num."%";
}
}else{
return $num ?? "--";
}
}

@ -132,12 +132,12 @@ class CompanyStatementController extends ThinkController
->order("FIELD(verify_status,0,1,-1,2,3,-2,-3),id desc")->page($page,$row)->select(); ->order("FIELD(verify_status,0,1,-1,2,3,-2,-3),id desc")->page($page,$row)->select();
foreach($data as $k => &$v) { foreach($data as $k => &$v) {
$v['statement_begin_time'] = date('Y-m-d',$v['statement_begin_time']); $v['statement_begin_time'] = date('Y.m.d',$v['statement_begin_time']);
$v['statement_end_time'] = date('Y-m-d',$v['statement_end_time']); $v['statement_end_time'] = date('Y.m.d',$v['statement_end_time']);
$v['company_belong'] = $this->CompanyBelong[$v['company_belong']]; $v['company_belong'] = $this->CompanyBelong[$v['company_belong']];
$v['op_time'] = date('Y-m-d H:i:s',$v['op_time']); $v['op_time'] = date('Y.m.d H:i:s',$v['op_time']);
$v["valid"] = "{$v['statement_begin_time']} ~ {$v['statement_end_time']}"; $v["valid"] = "{$v['statement_begin_time']}-{$v['statement_end_time']}";
$v['withdraw_type_1'] = ($v['withdraw_type'] == 1 ? "月结" :"周结"); $v['withdraw_type_1'] = ($v['withdraw_type'] == 1 ? "月结" :"周结");
@ -282,7 +282,7 @@ class CompanyStatementController extends ThinkController
$y = M("CompanyStatement", "tab_")->where("id='{$params['id']}'")->find(); $y = M("CompanyStatement", "tab_")->where("id='{$params['id']}'")->find();
if($y['first_party_info'] != $params['first_party_info'] || $y['second_party_info'] != $params['second_party_info'] || $y['statement_info'] != $params['statement_info']){ if($y['first_party_info'] != $params['first_party_info'] || $y['second_party_info'] != $params['second_party_info'] || $y['statement_info'] != $params['statement_info']){
$params['verify_status'] = 0; $params['verify_status'] = 0;
$params['verify_log'] = json_encode(["create_user"=>$this->admininfo["username"],"create_time"=>date("Y-m-d H:i:s")]); $params['verify_log'] = json_encode(["create_user"=>$this->admininfo["username"],"create_time"=>date("Y.m.d H:i:s")]);
$params['op_time'] = time(); $params['op_time'] = time();
M("CompanyStatement","tab_")->save($params); M("CompanyStatement","tab_")->save($params);
} }
@ -342,7 +342,7 @@ class CompanyStatementController extends ThinkController
if($v['confirm_status'] != 0) continue; if($v['confirm_status'] != 0) continue;
$v['confirm_log'] = json_decode($v['confirm_log'],true); $v['confirm_log'] = json_decode($v['confirm_log'],true);
$v['confirm_log']['launch_user']=$this->admininfo["username"]; $v['confirm_log']['launch_user']=$this->admininfo["username"];
$v['confirm_log']['launch_time']=date("Y-m-d H:i:s"); $v['confirm_log']['launch_time']=date("Y.m.d H:i:s");
$v['confirm_log'] = json_encode($v['confirm_log']); $v['confirm_log'] = json_encode($v['confirm_log']);
$v['confirm_status']=1; $v['confirm_status']=1;
// $v['op_time'] = time(); // $v['op_time'] = time();
@ -364,7 +364,7 @@ class CompanyStatementController extends ThinkController
if($v['verify_status'] != $old_status) continue; if($v['verify_status'] != $old_status) continue;
$v['verify_log'] = json_decode($v['verify_log'],true); $v['verify_log'] = json_decode($v['verify_log'],true);
$v['verify_log'][$op_pre.'_user']=$this->admininfo["username"]; $v['verify_log'][$op_pre.'_user']=$this->admininfo["username"];
$v['verify_log'][$op_pre.'_time']=date("Y-m-d H:i:s"); $v['verify_log'][$op_pre.'_time']=date("Y.m.d H:i:s");
$v['verify_log'] = json_encode($v['verify_log']); $v['verify_log'] = json_encode($v['verify_log']);
$v['verify_status']=$change_status; $v['verify_status']=$change_status;
$v['op_time'] = time(); $v['op_time'] = time();
@ -440,6 +440,12 @@ class CompanyStatementController extends ThinkController
} else{ } else{
$data['receive_company']['invoice_type']="普票"; $data['receive_company']['invoice_type']="普票";
} }
if($data['company_name'] == $data['first_party_info']['partner']){
$data['my_company'] = $data['second_party_info']['partner'];
}else{
$data['my_company'] = $data['first_party_info']['partner'];
}
if ($data['company_belong'] == 9) {//上游 if ($data['company_belong'] == 9) {//上游
excelUpStreamTemplate($data, $all_sum_money, $all_pay_amount, $big_all_sum_money); excelUpStreamTemplate($data, $all_sum_money, $all_pay_amount, $big_all_sum_money);
} else { } else {
@ -478,29 +484,20 @@ class CompanyStatementController extends ThinkController
"fine"=>0, "fine"=>0,
"reward"=>0, "reward"=>0,
"verify_status"=>0, "verify_status"=>0,
"verify_log"=>json_encode(["create_user"=>$this->admininfo["username"],"create_time"=>date("Y-m-d H:i:s")]), "verify_log"=>json_encode(["create_user"=>$this->admininfo["username"],"create_time"=>date("Y.m.d H:i:s")]),
"op_time"=>time(), "op_time"=>time(),
"company_list"=>[] "company_list"=>[]
]; ];
$datas = ["ups","up","downs","down"]; $datas = ["up","down"];
//初始化数据 //初始化数据
foreach($datas as $k=>$v){ foreach($datas as $k=>$v){
if($v =="ups"){
$basedata['company_type']=3;
$basedata['is_payment']=1;
}
if($v =="up"){ if($v =="up"){
$basedata['company_type']=3; $basedata['company_type']=3;
$basedata['is_payment']=2;
}
if($v =="downs"){
$basedata['company_type']=1;
$basedata['is_payment']=1; $basedata['is_payment']=1;
} }
if($v =="down"){ if($v =="down"){
$basedata['company_type']=1; $basedata['company_type']=1;
$basedata['is_payment']=2; $basedata['is_payment']=1;
} }
$datas[$v]=$basedata; $datas[$v]=$basedata;
unset($datas[$k]); unset($datas[$k]);
@ -510,18 +507,9 @@ class CompanyStatementController extends ThinkController
if($v['verify_status'] != 2) continue; if($v['verify_status'] != 2) continue;
if($v['company_belong'] == 9){ if($v['company_belong'] == 9){
//上游 //上游
if($v['is_payment'] == 1){ $this->setDf($datas['up'],$v);
$this->setDf($datas['ups'],$v);
}else{
$this->setDf($datas['up'],$v);
}
}else{ }else{
$this->setDf($datas['down'],$v);
if($v['is_payment'] == 1){
$this->setDf($datas['downs'],$v);
}else{
$this->setDf($datas['down'],$v);
}
} }
} }
$Pool = M("company_statement_pool","tab_"); $Pool = M("company_statement_pool","tab_");
@ -546,7 +534,7 @@ class CompanyStatementController extends ThinkController
if($v['statement_money'] == 0){ if($v['statement_money'] == 0){
$v['verify_status'] = 5; $v['verify_status'] = 5;
$v['verify_log'] = json_encode(["create_user"=>$this->admininfo["username"],"create_time"=>date("Y-m-d H:i:s"),"verify_user"=>"system","verify_time"=>date("Y-m-d H:i:s"),"payment_user"=>"system","payment_time"=>date("Y-m-d H:i:s")]); $v['verify_log'] = json_encode(["create_user"=>$this->admininfo["username"],"create_time"=>date("Y.m.d H:i:s"),"verify_user"=>"system","verify_time"=>date("Y.m.d H:i:s"),"payment_user"=>"system","payment_time"=>date("Y.m.d H:i:s")]);
} }
//判断周月结 //判断周月结
if(($v["statement_end_time"]-$v['statement_begin_time']) > 7*24*3600){ if(($v["statement_end_time"]-$v['statement_begin_time']) > 7*24*3600){
@ -580,7 +568,7 @@ class CompanyStatementController extends ThinkController
if($v['verify_status'] != $old_status) continue; if($v['verify_status'] != $old_status) continue;
$v['verify_log'] = json_decode($v['verify_log'],true); $v['verify_log'] = json_decode($v['verify_log'],true);
$v['verify_log'][$op_pre.'_user']=$this->admininfo["username"]; $v['verify_log'][$op_pre.'_user']=$this->admininfo["username"];
$v['verify_log'][$op_pre.'_time']=date("Y-m-d H:i:s"); $v['verify_log'][$op_pre.'_time']=date("Y.m.d H:i:s");
$v['verify_log'][$op_pre.'_num']=$num; $v['verify_log'][$op_pre.'_num']=$num;
$v['verify_log'] = json_encode($v['verify_log']); $v['verify_log'] = json_encode($v['verify_log']);
$v['verify_status']=$change_status; $v['verify_status']=$change_status;
@ -607,7 +595,7 @@ class CompanyStatementController extends ThinkController
unset($value["second_ratio"]); unset($value["second_ratio"]);
} }
} }
if($k=="ups" || $k=='downs'){ if($va['is_payment'] == 1){
$is_payment = 1; $is_payment = 1;
$verify_status = 0; $verify_status = 0;
}else{ }else{
@ -741,7 +729,8 @@ class CompanyStatementController extends ThinkController
"fine"=>$fine, "fine"=>$fine,
"reward"=>$reward, "reward"=>$reward,
"statement_info"=>$v['statement_info'], "statement_info"=>$v['statement_info'],
"statement_num"=>"JS_".date('Ymd').date('His').$v['company_id'].sp_random_string(5) "statement_num"=>"JS_".date('Ymd').date('His').$v['company_id'].sp_random_string(5),
"is_payment"=>$v['is_payment']
]; ];
$savedata['company_list'][$v['company_id']] = $tdata; $savedata['company_list'][$v['company_id']] = $tdata;
} }

@ -75,11 +75,11 @@ class CompanyStatementLackController extends ThinkController
foreach($data as $k => &$v) { foreach($data as $k => &$v) {
$v['statement_begin_time'] = date('Y-m-d',$v['statement_begin_time']); $v['statement_begin_time'] = date('Y.m.d',$v['statement_begin_time']);
$v['statement_end_time'] = date('Y-m-d',$v['statement_end_time']); $v['statement_end_time'] = date('Y.m.d',$v['statement_end_time']);
$v['is_payment_str'] = $this->IsPayment[$v['is_payment']]; $v['is_payment_str'] = $this->IsPayment[$v['is_payment']];
$v['company_type_str'] = $this->CompanyType[$v['company_type']]; $v['company_type_str'] = $this->CompanyType[$v['company_type']];
$v["valid"] = "{$v['statement_begin_time']} ~ {$v['statement_end_time']}"; $v["valid"] = "{$v['statement_begin_time']}-{$v['statement_end_time']}";
$v['oplist'] = $this->OpAuth($v); $v['oplist'] = $this->OpAuth($v);
} }
@ -146,7 +146,7 @@ class CompanyStatementLackController extends ThinkController
"fine"=>0, "fine"=>0,
"reward"=>0, "reward"=>0,
"verify_status"=>0, "verify_status"=>0,
"verify_log"=>json_encode(["create_user"=>$this->admininfo["username"],"create_time"=>date("Y-m-d H:i:s")]), "verify_log"=>json_encode(["create_user"=>$this->admininfo["username"],"create_time"=>date("Y.m.d H:i:s")]),
"op_time"=>time(), "op_time"=>time(),
"company_list"=>[] "company_list"=>[]
]; ];

@ -113,8 +113,8 @@ class CompanyStatementPoolController extends ThinkController
->page($page,$row)->select(); ->page($page,$row)->select();
foreach($data as $k => &$v) { foreach($data as $k => &$v) {
$v['statement_begin_time'] = date('Y-m-d',$v['statement_begin_time']); $v['statement_begin_time'] = date('Y.m.d',$v['statement_begin_time']);
$v['statement_end_time'] = date('Y-m-d',$v['statement_end_time']); $v['statement_end_time'] = date('Y.m.d',$v['statement_end_time']);
$v['company_type_str'] = $this->CompanyType[$v['company_type']]; $v['company_type_str'] = $this->CompanyType[$v['company_type']];
$v['is_payment_str'] = $this->IsPayment[$v['is_payment']]; $v['is_payment_str'] = $this->IsPayment[$v['is_payment']];
@ -123,8 +123,8 @@ class CompanyStatementPoolController extends ThinkController
$v['can_export'] = 1; $v['can_export'] = 1;
} }
$v['op_time'] = date('Y-m-d H:i:s',$v['op_time']); $v['op_time'] = date('Y.m.d H:i:s',$v['op_time']);
$v["valid"] = "{$v['statement_begin_time']} ~ {$v['statement_end_time']}"; $v["valid"] = "{$v['statement_begin_time']}-{$v['statement_end_time']}";
$v['ext_file_type'] = empty($v['ext_file']) ? "无" : "有"; $v['ext_file_type'] = empty($v['ext_file']) ? "无" : "有";
$v['withdraw_type'] = $this->WithdrawType[$v['withdraw_type']];; $v['withdraw_type'] = $this->WithdrawType[$v['withdraw_type']];;
@ -208,10 +208,15 @@ class CompanyStatementPoolController extends ThinkController
$infolist = M("company_statement_info","tab_")->field("*,'1' as st")->where("pool_id = '{$id}'")->select(); $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')->where("id={$id}")->find(); $pool_info = M("company_statement_pool","tab_")->field('statement_num,create_lack_ids,verify_status,is_payment')->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']; $statement_num = $pool_info['statement_num'];
$this->assign("title",$statement_num); $this->assign("title",$statement_num);
$this->assign("pool_status",$pool_info['verify_status']); $this->assign("pool_status",$pool_info['verify_status']);
$this->assign("pool_status",$pool_info['verify_status']);
$this->assign("is_payment",$pool_info['is_payment']); $this->assign("is_payment",$pool_info['is_payment']);
if($infolist[0]['company_type'] == 3){ if($infolist[0]['company_type'] == 3){
//上游 //上游
@ -220,20 +225,12 @@ class CompanyStatementPoolController extends ThinkController
//下游公司 //下游公司
$this->viewPcPool($infolist,$is_export); $this->viewPcPool($infolist,$is_export);
}else{ }else{
//获取母单
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);
}
$this->viewPuPool($infolist,$is_export); $this->viewPuPool($infolist,$is_export);
} }
} }
//个人汇总结算查看 //个人汇总结算查看
public function viewPuPool(&$infolist,$is_export){ public function viewPuPool(&$infolist,$is_export){
// dd($infolist);
$line = 1; $line = 1;
$count = []; $count = [];
//获取对接人 //获取对接人
@ -242,6 +239,13 @@ class CompanyStatementPoolController extends ThinkController
$v['company_info'] = json_decode($v['company_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_begin_time'] = date('Y.m.d',$v['statement_begin_time']);
$v['statement_end_time'] = date('Y.m.d',$v['statement_end_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; $cline = $line+1;
if($is_export){ if($is_export){
$v['sum_money_exp'] = "="; $v['sum_money_exp'] = "=";
@ -292,8 +296,16 @@ class CompanyStatementPoolController extends ThinkController
unset($pl); unset($pl);
foreach($infolist as $k=>&$v){ foreach($infolist as $k=>&$v){
$v['statement_info'] = json_decode($v['statement_info'],true); $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_begin_time'] = date('Y.m.d',$v['statement_begin_time']);
$v['statement_end_time'] = date('Y.m.d',$v['statement_end_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; $cline = $line+1;
if($is_export){ if($is_export){
$v['statement_money_exp'] = "="; $v['statement_money_exp'] = "=";
@ -310,10 +322,6 @@ class CompanyStatementPoolController extends ThinkController
$v['statement_money_exp'] .= "H{$line}+"; $v['statement_money_exp'] .= "H{$line}+";
$va['d_statement_money'] = "=D{$line}*(1-G{$line})*(E{$line}+F{$line})"; $va['d_statement_money'] = "=D{$line}*(1-G{$line})*(E{$line}+F{$line})";
$count['platform_amount_exp'] .= "D{$line}+";
$count['d_statement_money_exp'] .= "H{$line}+";
}else{ }else{
$va['d_statement_money'] = round($va['pay_amount']*($va['ratio']+$va['increment_ratio'])*(100-$va['fax_ratio'])/100/100,2); $va['d_statement_money'] = round($va['pay_amount']*($va['ratio']+$va['increment_ratio'])*(100-$va['fax_ratio'])/100/100,2);
@ -327,11 +335,6 @@ class CompanyStatementPoolController extends ThinkController
if($is_export){ if($is_export){
$v['statement_money_exp'] .= "J{$cline}-I{$cline}"; $v['statement_money_exp'] .= "J{$cline}-I{$cline}";
$v['statement_money'] = $v['statement_money_exp']; $v['statement_money'] = $v['statement_money_exp'];
$count['fine_exp'] .= "I{$cline}+";
$count['reward_exp'] .= "J{$cline}+";
$count['statement_money_exp'] .= "K{$cline}+";
}else{ }else{
$count['fine'] += $v['fine']; $count['fine'] += $v['fine'];
$count['reward'] += $v['reward']; $count['reward'] += $v['reward'];
@ -341,13 +344,13 @@ class CompanyStatementPoolController extends ThinkController
} }
if($is_export){ if($is_export){
$count["d_statement_money"] = "=".trim($count["d_statement_money_exp"],"+"); $count["platform_amount"] = "=SUM(D2:D".$line.")";
$count["platform_amount"] = "=".trim($count["platform_amount_exp"],"+"); $count["d_statement_money"] = "=SUM(H2:H".$line.")";
$count["fine"] = "=".trim($count["fine_exp"],"+"); $count["fine"] = "=SUM(I2:I".$line.")";
$count["reward"] = "=".trim($count["reward_exp"],"+"); $count["reward"] = "=SUM(J2:J".$line.")";
$count["statement_money"] = "=".trim($count["statement_money_exp"],"+"); $count["statement_money"] = "=SUM(K2:K".$line.")";
} }
// dd($infolist);
$this->assign("data",$infolist); $this->assign("data",$infolist);
$this->assign("count",$count); $this->assign("count",$count);
$this->assign("is_export",$is_export); $this->assign("is_export",$is_export);
@ -372,8 +375,18 @@ class CompanyStatementPoolController extends ThinkController
// //
foreach($infolist as $k=>&$v){ foreach($infolist as $k=>&$v){
$v['statement_info'] = json_decode($v['statement_info'],true); $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_begin_time'] = date('Y.m.d',$v['statement_begin_time']);
$v['statement_end_time'] = date('Y.m.d',$v['statement_end_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; $cline = $line+1;
if($is_export){ if($is_export){
$v['statement_money_exp'] = "="; $v['statement_money_exp'] = "=";
@ -384,9 +397,6 @@ class CompanyStatementPoolController extends ThinkController
if($is_export){ if($is_export){
$v['statement_money_exp'] .= "K{$line}+"; $v['statement_money_exp'] .= "K{$line}+";
$va['d_statement_money'] = "=F{$line}*G{$line}"; $va['d_statement_money'] = "=F{$line}*G{$line}";
$count['platform_amount_exp'] .= "E{$line}+";
$count['platform_amount_exp2'] .= "F{$line}+";
$count['d_statement_money_exp'] .= "K{$line}+";
}else{ }else{
$va['d_statement_money'] = round($va['pay_amount']*$va['ratio']/100,2); $va['d_statement_money'] = round($va['pay_amount']*$va['ratio']/100,2);
$count['platform_amount'] += $va['pay_amount']; $count['platform_amount'] += $va['pay_amount'];
@ -398,9 +408,6 @@ class CompanyStatementPoolController extends ThinkController
if($is_export){ if($is_export){
$v['statement_money_exp'] .= "M{$cline}-L{$cline}"; $v['statement_money_exp'] .= "M{$cline}-L{$cline}";
$v['statement_money'] = $v['statement_money_exp']; $v['statement_money'] = $v['statement_money_exp'];
$count['fine_exp'] .= "L{$cline}+";
$count['reward_exp'] .= "M{$cline}+";
$count['statement_money_exp'] .= "N{$cline}+";
}else{ }else{
$count['fine'] += $v['fine']; $count['fine'] += $v['fine'];
$count['reward'] += $v['reward']; $count['reward'] += $v['reward'];
@ -410,13 +417,14 @@ class CompanyStatementPoolController extends ThinkController
} }
if($is_export){ if($is_export){
$count["d_statement_money"] = "=".trim($count["d_statement_money_exp"],"+"); $count["d_statement_money"] = "=SUM(K3:K".$line.")";
$count["platform_amount"] = "=".trim($count["platform_amount_exp"],"+"); $count["platform_amount"] = "=SUM(E3:E".$line.")";
$count["platform_amount2"] = "=".trim($count["platform_amount_exp2"],"+"); $count["platform_amount2"] = "=SUM(F3:F".$line.")";
$count["fine"] = "=".trim($count["fine_exp"],"+"); $count["fine"] = "=SUM(L3:L".$line.")";
$count["reward"] = "=".trim($count["reward_exp"],"+"); $count["reward"] = "=SUM(M3:M".$line.")";
$count["statement_money"] = "=".trim($count["statement_money_exp"],"+"); $count["statement_money"] = "=SUM(N3:N".$line.")";
} }
// dd($infolist);
$this->assign("data",$infolist); $this->assign("data",$infolist);
$this->assign("count",$count); $this->assign("count",$count);
$this->assign("is_export",$is_export); $this->assign("is_export",$is_export);
@ -457,7 +465,7 @@ class CompanyStatementPoolController extends ThinkController
if($v['verify_status'] != $old_status) continue; if($v['verify_status'] != $old_status) continue;
$v['verify_log'] = json_decode($v['verify_log'],true); $v['verify_log'] = json_decode($v['verify_log'],true);
$v['verify_log'][$op_pre.'_user']=$this->admininfo["username"]; $v['verify_log'][$op_pre.'_user']=$this->admininfo["username"];
$v['verify_log'][$op_pre.'_time']=date("Y-m-d H:i:s"); $v['verify_log'][$op_pre.'_time']=date("Y.m.d H:i:s");
$v['verify_log'] = json_encode($v['verify_log']); $v['verify_log'] = json_encode($v['verify_log']);
$v['verify_status']=$change_status; $v['verify_status']=$change_status;
$this->DBModel->save($v); $this->DBModel->save($v);
@ -475,7 +483,7 @@ class CompanyStatementPoolController extends ThinkController
$dbres = $this->DBModel->field("id,verify_status,verify_log")->where("id = {$id}")->find(); $dbres = $this->DBModel->field("id,verify_status,verify_log")->where("id = {$id}")->find();
$dbres['verify_log'] = json_decode($dbres['verify_log'],true); $dbres['verify_log'] = json_decode($dbres['verify_log'],true);
$dbres['verify_log'][$op_pre.'_user']=$this->admininfo["username"]; $dbres['verify_log'][$op_pre.'_user']=$this->admininfo["username"];
$dbres['verify_log'][$op_pre.'_time']=date("Y-m-d H:i:s"); $dbres['verify_log'][$op_pre.'_time']=date("Y.m.d H:i:s");
$dbres['verify_log'] = json_encode($dbres['verify_log']); $dbres['verify_log'] = json_encode($dbres['verify_log']);
$dbres['verify_status']=$change_status; $dbres['verify_status']=$change_status;
$this->DBModel->save($dbres); $this->DBModel->save($dbres);
@ -492,16 +500,22 @@ class CompanyStatementPoolController extends ThinkController
$id = $_REQUEST['id']; $id = $_REQUEST['id'];
$CompanyInfo = M("company_statement_info","tab_") $CompanyInfo = M("company_statement_info","tab_")
->alias('i') ->alias('i')
->field("i.id,i.pool_id,i.company_name,i.company_info,i.statement_money,p.statement_num,i.remark,i.pay_status,p.statement_money all_money") ->field("i.id,i.pool_id,i.company_name,i.company_info,i.statement_money,p.statement_num,i.remark,i.pay_status,p.statement_money all_money,i.verify_status")
->join("tab_company_statement_pool p ON p.id = i.pool_id") ->join("tab_company_statement_pool p ON p.id = i.pool_id")
->where("pool_id='{$id}'") ->where("pool_id='{$id}'")
->select(); ->select();
foreach($CompanyInfo as $k=>&$v){ foreach($CompanyInfo as $k=>&$v){
if($v['verify_status'] == 2){
$v['is_payment'] = 2;
}else{
$v['is_payment'] = 1;
}
$v['company_info'] = json_decode($v['company_info'],true); $v['company_info'] = json_decode($v['company_info'],true);
$v['company_info']['ali_user'] ?? ''; $v['company_info']['ali_user'] ?? '';
$v['company_info']['ali_account'] ?? ''; $v['company_info']['ali_account'] ?? '';
} }
$this->assign("CompanyInfo",$CompanyInfo); $this->assign("CompanyInfo",$CompanyInfo);
$this->assign("id",$id); $this->assign("id",$id);
$this->display(); $this->display();
@ -514,25 +528,31 @@ class CompanyStatementPoolController extends ThinkController
//循环保存 //循环保存
foreach($info as $k=>$v){ foreach($info as $k=>$v){
$ydata = $CompanyInfo->where("id= '{$k}'")->find(); $ydata = $CompanyInfo->where("id= '{$k}'")->find();
if($ydata['verify_status'] == 2){continue;}
$company_info = json_decode($ydata['company_info'],true); $company_info = json_decode($ydata['company_info'],true);
$company_info['ali_user'] = $v['ali_user']; if($ydata['verify_status'] == 2){
$company_info['ali_account'] = $v['ali_account']; $company_info['payee_name'] = $v['payee_name'];
$company_info['bank_account'] = $v['bank_account'];
$company_info['opening_bank'] = $v['opening_bank'];
}else{
$company_info['ali_user'] = $v['ali_user'];
$company_info['ali_account'] = $v['ali_account'];
}
$savedata = [ $savedata = [
"company_info"=>json_encode($company_info,JSON_UNESCAPED_UNICODE), "company_info"=>json_encode($company_info,JSON_UNESCAPED_UNICODE),
"remark"=>$v['remark'], "remark"=>$v['remark'],
"id"=>$k "id"=>$k
]; ];
if(empty($v['ali_user']) || empty($v['ali_account'])){ if($ydata['verify_status'] != 2){
$savedata['verify_status'] = -1; if(empty($v['ali_user']) || empty($v['ali_account'])){
}else{ $savedata['verify_status'] = -1;
$savedata['verify_status'] = 1; }else{
$savedata['verify_status'] = 1;
}
} }
$CompanyInfo->save($savedata); $CompanyInfo->save($savedata);
} }
//修改状态 //修改状态
$this->setOneVerifyStatus(2,"payment",$_REQUEST['pool_id'],$mgs = "打款信息提交"); $this->setOneVerifyStatus(2,"payment",$_REQUEST['pool_id'],$mgs = "打款信息确认");
} }
//查看打款信息 //查看打款信息
public function viewPayment(){ public function viewPayment(){
@ -693,13 +713,11 @@ class CompanyStatementPoolController extends ThinkController
'verify_status'=>0 'verify_status'=>0
]; ];
// //
if(empty($pool_data['create_lack_ids'])){ if(empty($pool['create_lack_ids'])){
$pool_data['create_lack_ids'] = $l_id; $pool_data['create_lack_ids'] = $l_id;
}else{ }else{
$pool_data['create_lack_ids'] = $pool_data['create_lack_ids'].",".$l_id; $pool_data['create_lack_ids'] = $pool['create_lack_ids'].",".$l_id;
} }
$info_ids = explode(",",$pool['info_ids']);
$pool_data['info_ids'] =implode(",",array_diff($info_ids,[$id]));
M("company_statement_pool","tab_")->save($pool_data); M("company_statement_pool","tab_")->save($pool_data);
M("company_statement_info","tab_")->where("id='{$id}'")->delete(); M("company_statement_info","tab_")->where("id='{$id}'")->delete();
$this->ajaxReturn(array( $this->ajaxReturn(array(
@ -777,12 +795,12 @@ class CompanyStatementPoolController extends ThinkController
$this->ajaxReturn(array('status' => 0,"info"=>"重算失败")); $this->ajaxReturn(array('status' => 0,"info"=>"重算失败"));
} }
} }
M()->commit();
//重新计算 //重新计算
$stime = $info['statement_end_time']-0+1; $stime = $info['statement_end_time']-0+1;
$type = $info['withdraw_type']; $type = $info['withdraw_type'];
A("CompanyStatementSet")->promoteUserPool($type,$stime,true,$info['is_payment']);
A("CompanyStatementSet")->promoteUserPool($type,$stime,true);
M()->commit();
$this->ajaxReturn(array( $this->ajaxReturn(array(
'status' => 1, 'status' => 1,
'info' => "重算成功" 'info' => "重算成功"
@ -836,7 +854,7 @@ class CompanyStatementPoolController extends ThinkController
foreach($st_res as $k=>&$v){ foreach($st_res as $k=>&$v){
$v['verify_log'] = json_decode($v['verify_log'],true); $v['verify_log'] = json_decode($v['verify_log'],true);
$v['verify_log']['pool_user']=$this->admininfo["username"]; $v['verify_log']['pool_user']=$this->admininfo["username"];
$v['verify_log']['pool_time']=date("Y-m-d H:i:s"); $v['verify_log']['pool_time']=date("Y.m.d H:i:s");
$v['verify_log'] = json_encode($v['verify_log']); $v['verify_log'] = json_encode($v['verify_log']);
$v['verify_status']=-3; $v['verify_status']=-3;
$stres = M("company_statement","tab_")->save($v); $stres = M("company_statement","tab_")->save($v);
@ -901,7 +919,7 @@ class CompanyStatementPoolController extends ThinkController
"setUlPayment"=>"<a class='confirm setUlPayment' data-id='{$id}'>线下打款</a>", "setUlPayment"=>"<a class='confirm setUlPayment' data-id='{$id}'>线下打款</a>",
"setPayment"=>"<a class='confirm setPayment' data-id='{$id}'>打款信息提交</a>", "setPayment"=>"<a class='confirm setPayment' data-id='{$id}'>打款信息确认</a>",
"editPayment"=>"<a class='confirm editPayment' data-id='{$id}'>打款信息编辑</a>", "editPayment"=>"<a class='confirm editPayment' data-id='{$id}'>打款信息编辑</a>",
"viewPayment"=>"<a class='confirm viewPayment' data-id='{$id}'>打款详情</a>", "viewPayment"=>"<a class='confirm viewPayment' data-id='{$id}'>打款详情</a>",

@ -327,11 +327,11 @@ class CompanyStatementSetController extends Controller {
} }
} }
if($v['first_company_type'] == 1){ if($v['first_company_type'] == 1){
$game['first_ratio']=$tratio; $game['first_ratio']=$tratio-0;
$game['second_ratio']=100-$tratio; $game['second_ratio']=100-$tratio;
}else{ }else{
$game['first_ratio']=100-$tratio; $game['first_ratio']=100-$tratio;
$game['second_ratio']=$tratio; $game['second_ratio']=$tratio-0;
} }
$add_data['pay_amount'] += $va['pay_money']; $add_data['pay_amount'] += $va['pay_money'];
@ -634,7 +634,7 @@ class CompanyStatementSetController extends Controller {
$tratio = $tratio1-$tratio2+$company_ratio; $tratio = $tratio1-$tratio2+$company_ratio;
if($tratio <= 0){ continue;} if($tratio <= 0){ continue;}
} }
$tratio = $tratio-0;
if($v['type'] == 2){ if($v['type'] == 2){
$game['increment_ratio']=$tratio; $game['increment_ratio']=$tratio;
}else{ }else{
@ -793,12 +793,12 @@ class CompanyStatementSetController extends Controller {
} }
} }
public function promoteUserPool($type,$stime,$recount = false,$is_payment=false){ public function promoteUserPool($type,$stime,$recount = false){
$t = $this->setBeginAndEndTime($type,$stime); $t = $this->setBeginAndEndTime($type,$stime);
$begintime = $t[0]; $begintime = $t[0];
$endtime = $t[1]; $endtime = $t[1];
$basedata = [ $user = [
"pay_amount"=>0, "pay_amount"=>0,
"statement_money"=>0, "statement_money"=>0,
"lack_statement_money"=>0, "lack_statement_money"=>0,
@ -813,45 +813,40 @@ class CompanyStatementSetController extends Controller {
"verify_status"=>0, "verify_status"=>0,
"company_type"=>2, "company_type"=>2,
"verify_log"=>json_encode(["create_user"=>"system","create_time"=>date("Y-m-d H:i:s")]), "verify_log"=>json_encode(["create_user"=>"system","create_time"=>date("Y-m-d H:i:s")]),
"op_time"=>time() "op_time"=>time(),
"statement_num"=>"PL_".date('Ymd').date('His').sp_random_num(3)
]; ];
$users = $user = $basedata; // $users = $user = $basedata;
$users['is_payment'] = 1; // $users['is_payment'] = 1;
$users['statement_num'] = "PL_".date('Ymd').date('His').sp_random_num(3); // $users['statement_num'] = "PL_".date('Ymd').date('His').sp_random_num(3);
$user['is_payment'] = 2; // $user['is_payment'] = 2;
$user['statement_num'] = "PL_".date('Ymd').date('His').sp_random_num(3); // $user['statement_num'] = "PL_".date('Ymd').date('His').sp_random_num(3);
if($type == 0){//周结 if($type == 0){//周结
$this->doPromoteUserPool($user,$users,$type,$stime,$recount); $this->doPromoteUserPool($user,0,$stime,$recount);
}else if($type == 1){ }else if($type == 1){
$users['withdraw_type'] = 1; $users['withdraw_type'] = 1;
$user['withdraw_type'] = 1; $user['withdraw_type'] = 1;
//月结&补点 //月结&补点
$this->doPromoteUserPool($user,$users,1,$stime,$recount); $this->doPromoteUserPool($user,1,$stime,$recount);
}else{ }else{
$users['withdraw_type'] = 2; $users['withdraw_type'] = 2;
$user['withdraw_type'] = 2; $user['withdraw_type'] = 2;
$this->doPromoteUserPool($user,$users,2,$stime,$recount); $this->doPromoteUserPool($user,2,$stime,$recount);
}
if($is_payment !== false && $is_payment==1){
$this->savePromotateUserPool($users);
}else if($is_payment !== false && $is_payment==2){
$this->savePromotateUserPool($user);
}else{
$this->savePromotateUserPool($users);
$this->savePromotateUserPool($user);
} }
$this->savePromotateUserPool($user);
} }
/** /**
* 下游个人汇总单 * 下游个人汇总单
*/ */
public function doPromoteUserPool(&$user,&$users,$type,$stime,$recount = false) public function doPromoteUserPool(&$user,$type,$stime,$recount = false)
{ {
$t = $this->setBeginAndEndTime($type,$stime); $t = $this->setBeginAndEndTime($type,$stime);
$begintime = $t[0]; $begintime = $t[0];
@ -900,11 +895,11 @@ class CompanyStatementSetController extends Controller {
"company_id"=>$v['id'], "company_id"=>$v['id'],
"withdraw_done"=>1 "withdraw_done"=>1
]; ];
$pres = $Promote->field("alipay_account,alipay_real_name")->where($p_map)->find(); // $pres = $Promote->field("alipay_account,alipay_real_name")->where($p_map)->find();
if(!empty($pres) && !empty($pres['alipay_account']) && !empty($pres['alipay_real_name'])){ // if(!empty($pres) && !empty($pres['alipay_account']) && !empty($pres['alipay_real_name'])){
$v['ali_user'] = $pres['alipay_real_name']; // $v['ali_user'] = $pres['alipay_real_name'];
$v['ali_account'] = $pres['alipay_account']; // $v['ali_account'] = $pres['alipay_account'];
} // }
if($v['has_ratio']){ if($v['has_ratio']){
$v['turnover_ratio'] = json_decode($v['turnover_ratio'],true); $v['turnover_ratio'] = json_decode($v['turnover_ratio'],true);
} }
@ -932,11 +927,7 @@ class CompanyStatementSetController extends Controller {
} }
//获取其他信息 //获取其他信息
$v = $this->getCompanyOtherInfo($v,$k); $v = $this->getCompanyOtherInfo($v,$k);
if($v['is_payment'] == 1){ $countdata = &$user;
$countdata = &$users;
}else{
$countdata = &$user;
}
$v['statement_money'] = 0; $v['statement_money'] = 0;
$v['pay_amount'] = 0; $v['pay_amount'] = 0;
$v['fine'] = 0; $v['fine'] = 0;
@ -1117,12 +1108,19 @@ class CompanyStatementSetController extends Controller {
* 保存信息汇总信息 * 保存信息汇总信息
*/ */
public function savePromotateUserPool($data){ public function savePromotateUserPool($data){
if(IS_CLI){
$op_name ="system";
}else{
$op_name =$_SESSION['onethink_admin']['user_auth']["username"];
}
if(empty($data['create_lack_ids']) && empty($data['del_lack_ids']) && empty($data['info_ids'])){ //补点为空不重算 if(empty($data['create_lack_ids']) && empty($data['del_lack_ids']) && empty($data['info_ids'])){ //补点为空不重算
return ; return ;
} }
if($data['statement_money'] == 0){ if($data['statement_money'] == 0){
$data['verify_status'] = 5; $data['verify_status'] = 5;
$data['verify_log'] = json_encode(["create_user"=>"system","create_time"=>date("Y-m-d H:i:s"),"verify_user"=>"system","verify_time"=>date("Y-m-d H:i:s"),"payment_user"=>"system","payment_time"=>date("Y-m-d H:i:s")]); $data['verify_log'] = json_encode(["create_user"=>$op_name,"create_time"=>date("Y-m-d H:i:s"),"verify_user"=>"system","verify_time"=>date("Y-m-d H:i:s"),"payment_user"=>"system","payment_time"=>date("Y-m-d H:i:s")]);
}else{
$data['verify_log'] = json_encode(["create_user"=>$op_name,"create_time"=>date("Y-m-d H:i:s")]);
} }
$data['create_lack_ids'] = implode(",",$data['create_lack_ids']); $data['create_lack_ids'] = implode(",",$data['create_lack_ids']);
$data['del_lack_ids'] = implode(",",$data['del_lack_ids']); $data['del_lack_ids'] = implode(",",$data['del_lack_ids']);

@ -210,7 +210,7 @@
<tbody id="statementShow"> <tbody id="statementShow">
<foreach name="data.statement_info" item="it" > <foreach name="data.statement_info" item="it" >
<tr> <tr>
<td>{$it.statement_begin_time}~{$it.statement_end_time}</td> <td>{$it.statement_begin_time}-{$it.statement_end_time}</td>
<td>{$it.game_name}</td> <td>{$it.game_name}</td>
<if condition="$it['statement_type'] eq 1"> <if condition="$it['statement_type'] eq 1">
<td>-{$it.pay_amount}</td> <td>-{$it.pay_amount}</td>
@ -218,10 +218,10 @@
<td>{$it.pay_amount}</td> <td>{$it.pay_amount}</td>
</if> </if>
<if condition="$it['statement_type'] eq 0"> <if condition="$it['statement_type'] eq 0">
<td>{$it.first_ratio}%</td> <td>{$it.first_ratio|showNumPercent}</td>
<td>{$it.second_ratio}%</td> <td>{$it.second_ratio|showNumPercent}</td>
<td>{$it.promote_ratio}%</td> <td>{$it.promote_ratio|showNumPercent}</td>
<td>{$it.fax_ratio}%</td> <td>{$it.fax_ratio|showNumPercent}</td>
<else /> <else />
<td></td> <td></td>
<td></td> <td></td>
@ -240,12 +240,12 @@
<tr> <tr>
<td>合计</td> <td>合计</td>
<td></td> <td></td>
<td>{$data.statement_count.pay_amount}</td> <td>{$data['statement_count']['pay_amount']-0}</td>
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td>{$data.statement_count.statement_money}</td> <td>{$data['statement_count']['statement_money']-0}</td>
</tr> </tr>
<tr> <tr>
<td colspan=7>本月分成总金额(人民币大写):</td> <td colspan=7>本月分成总金额(人民币大写):</td>

@ -206,7 +206,7 @@
<tbody id="statementShow"> <tbody id="statementShow">
<foreach name="data.statement_info" item="it" > <foreach name="data.statement_info" item="it" >
<tr> <tr>
<td>{$it.statement_begin_time}~{$it.statement_end_time}</td> <td>{$it.statement_begin_time}-{$it.statement_end_time}</td>
<td>{$it.game_name}</td> <td>{$it.game_name}</td>
<if condition="$it['statement_type'] eq 1"> <if condition="$it['statement_type'] eq 1">
<td>-{$it.pay_amount}</td> <td>-{$it.pay_amount}</td>
@ -215,11 +215,11 @@
</if> </if>
<if condition="$it['statement_type'] eq 0"> <if condition="$it['statement_type'] eq 0">
<if condition="$data['withdraw_type'] eq 2"> <if condition="$data['withdraw_type'] eq 2">
<td>{$it.increment_ratio}%</td> <td>{$it.increment_ratio|showNumPercent}</td>
<else /> <else />
<td>{$it.ratio}%</td> <td>{$it.ratio|showNumPercent}</td>
</if> </if>
<td>{$it.fax_ratio}%</td> <td>{$it.fax_ratio|showNumPercent}</td>
<else /> <else />
<td></td> <td></td>
<td></td> <td></td>
@ -236,10 +236,10 @@
<tr> <tr>
<td>合计</td> <td>合计</td>
<td></td> <td></td>
<td>{$data.statement_count.pay_amount}</td> <td>{$data['statement_count']['pay_amount']-0}</td>
<td></td> <td></td>
<td></td> <td></td>
<td>{$data.statement_count.statement_money}</td> <td>{$data['statement_count']['statement_money']-0}</td>
</tr> </tr>
<tr> <tr>
<td colspan=5>本月分成总金额(人民币大写):</td> <td colspan=5>本月分成总金额(人民币大写):</td>

@ -155,7 +155,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> <th>不结算金额</th>
@ -182,7 +182,7 @@
<td>{$data.valid}</td> <td>{$data.valid}</td>
<td>{$data.company_type_str}</td> <td>{$data.company_type_str}</td>
<td>{$data.withdraw_type}</td> <td>{$data.withdraw_type}</td>
<td>{$data.is_payment_str}</td> <!-- <td>{$data.is_payment_str}</td> -->
<td>{$data.statement_money}</td> <td>{$data.statement_money}</td>
<!-- <td>{$data.platform_amount}</td> --> <!-- <td>{$data.platform_amount}</td> -->
<td>{$data.lack_statement_money}</td> <td>{$data.lack_statement_money}</td>
@ -430,7 +430,7 @@
title: "海南万盟天下科技有限公司", title: "海南万盟天下科技有限公司",
shadeClose: true, shadeClose: true,
shade: 0.8, shade: 0.8,
area: ['70%', '80%'], area: ['80%', '80%'],
content: url content: url
}); });
}) })

@ -105,10 +105,14 @@
<tr> <tr>
<th style="border-right: solid 1px #b6cad2;">序号</th> <th style="border-right: solid 1px #b6cad2;">序号</th>
<th style="border-right: solid 1px #b6cad2;">合作公司</th> <th style="border-right: solid 1px #b6cad2;">合作公司</th>
<th style="border-right: solid 1px #b6cad2;">支付宝真实名称</th> <th style="border-right: solid 1px #b6cad2;">是否支付宝打款</th>
<th style="border-right: solid 1px #b6cad2;">支付宝账号</th>
<th style="border-right: solid 1px #b6cad2;">户名</th>
<th style="border-right: solid 1px #b6cad2;">帐号</th>
<th style="border-right: solid 1px #b6cad2;">开户行</th>
<th style="border-right: solid 1px #b6cad2;">关联结算汇总单订单号</th> <th style="border-right: solid 1px #b6cad2;">关联结算汇总单订单号</th>
<th style="border-right: solid 1px #b6cad2;">金额(元)</th> <th style="border-right: solid 1px #b6cad2;">结算金额(元)</th>
<th style="border-right: solid 1px #b6cad2;">备注</th> <th style="border-right: solid 1px #b6cad2;">备注</th>
</tr> </tr>
</thead> </thead>
@ -118,8 +122,18 @@
<tr> <tr>
<td>{$key-0+1}</td> <td>{$key-0+1}</td>
<td>{$vo.company_name}</td> <td>{$vo.company_name}</td>
<td><input type="text" class="txt paymentset" data-id="{$vo.id}" name="ali_user" value="{$vo.company_info.ali_user}" placeholder="支付宝真实名称"></td> <if condition="$vo['is_payment'] eq 1">
<td><input type="text" class="txt paymentset" data-id="{$vo.id}" name="ali_account" value="{$vo.company_info.ali_account}" placeholder="支付宝账号"></td> <td></td>
<td><input type="text" class="txt paymentset" data-id="{$vo.id}" name="ali_user" value="{$vo.company_info.ali_user}" placeholder="支付宝真实名称"></td>
<td><input type="text" class="txt paymentset" data-id="{$vo.id}" name="ali_account" value="{$vo.company_info.ali_account}" placeholder="支付宝账号"></td>
<td></td>
<else />
<td></td>
<td><input type="text" class="txt paymentset" data-id="{$vo.id}" name="payee_name" value="{$vo.company_info.payee_name}" placeholder="银行帐户名"></td>
<td><input type="text" class="txt paymentset" data-id="{$vo.id}" name="bank_account" value="{$vo.company_info.bank_account}" placeholder="银行帐号"></td>
<td><input type="text" class="txt paymentset" data-id="{$vo.id}" name="opening_bank" value="{$vo.company_info.opening_bank}" placeholder="开户行"></td>
</if>
<td>{$vo.statement_num}</td> <td>{$vo.statement_num}</td>
<td>{$vo.statement_money}</td> <td>{$vo.statement_money}</td>
<td><input type="text" class="txt paymentset" data-id="{$vo.id}" name="remark" value="{$vo.remark}" placeholder="备注"></td> <td><input type="text" class="txt paymentset" data-id="{$vo.id}" name="remark" value="{$vo.remark}" placeholder="备注"></td>
@ -128,8 +142,18 @@
<tr> <tr>
<td>{$key-0+1}</td> <td>{$key-0+1}</td>
<td>{$vo.company_name}</td> <td>{$vo.company_name}</td>
<td>{$vo.company_info.ali_user}</td>
<td>{$vo.company_info.ali_account}</td> <if condition="$vo['is_payment'] eq 1">
<td></td>
<td>{$vo.company_info.ali_user}</td>
<td>{$vo.company_info.ali_account}</td>
<td></td>
<else />
<td></td>
<td>{$vo.company_info.payee_name}</td>
<td>{$vo.company_info.bank_account}</td>
<td>{$vo.company_info.opening_bank}</td>
</if>
<td>{$vo.statement_num}</td> <td>{$vo.statement_num}</td>
<td>{$vo.statement_money}</td> <td>{$vo.statement_money}</td>
<td>{$vo.remark}</td> <td>{$vo.remark}</td>
@ -139,7 +163,7 @@
</foreach> </foreach>
<tr> <tr>
<td colspan="2">合计:</td> <td colspan="2">合计:</td>
<td colspan="5">打款总金额:{$CompanyInfo[0]['all_money']}</td> <td colspan="7">结算总金额:{$CompanyInfo[0]['all_money']}</td>
</tr> </tr>
</tbody> </tbody>
@ -155,47 +179,20 @@
<script> <script>
$("#setPayment").on("click",function(){ $("#setPayment").on("click",function(){
var sendObj = {}; var sendObj = {};
var url = "{:U('editPayment')}" var url = "{:U('editPayment')}";
$("input[name='ali_user']").map(function(index,elem) { $("input[name='ali_user'],input[name='ali_account'],input[name='remark'],input[name='payee_name'],input[name='bank_account'],input[name='opening_bank']").map(function(index,elem) {
var id = $(elem).data("id"); var id = $(elem).data("id");
var to = { var e = $(elem).attr("name");
"ali_user":$(elem).val(), var v = $(elem).val();
"ali_account":'',
"remark":''
}
sendObj[id]=to;
});
$("input[name='ali_account']").map(function(index,elem) {
var id = $(elem).data("id");
if(id in sendObj){ if(id in sendObj){
sendObj[id]['ali_account']=$(elem).val(); sendObj[id][e] = v;
}else{ }else{
var to = { sendObj[id] = {};
"ali_account":$(elem).val(), sendObj[id][e] = v;
"ali_user":'',
"remark":''
}
sendObj[id]=to;
} }
}); });
$("input[name='remark']").map(function(index,elem) {
var id = $(elem).data("id");
if(id in sendObj){
sendObj[id]['remark']=$(elem).val();
}else{
var to = {
"remark":$(elem).val(),
"ali_user":'',
"ali_account":''
}
sendObj[id]=to;
}
});
layer.confirm("若支付宝账号及真实姓名不全的公司,将无法进行打款。请认真核对,点击取消返回",{title:false}, function(index){ layer.confirm("若支付宝账号及真实姓名不全的公司,将无法进行打款。请认真核对,点击取消返回",{title:false}, function(index){
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: url, url: url,
@ -215,7 +212,6 @@
} }
} }
}); });
}); });
}) })

@ -112,12 +112,23 @@
<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> <th rowspan="2" style="border-right: solid 1px #b6cad2;">备注</th>
<th rowspan="2" style="border-right: solid 1px #b6cad2;">操作</th>
</tr> </tr>
<tr> <tr>
<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> <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> </tr>
</thead> </thead>
<tbody id="statementShow"> <tbody id="statementShow">
@ -126,33 +137,59 @@
<td rowspan="{$com.statement_count}">{$com.company_name}</td> <td rowspan="{$com.statement_count}">{$com.company_name}</td>
<td rowspan="{$com.statement_count}">{$com.matche_platform}</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_count}">{$com.statement_begin_time} ~ {$com.statement_end_time}</td> -->
<td>{$com['statement_info'][0]['statement_begin_time']} - {$com['statement_info'][0]['statement_end_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]['game_name']}</td>
<td>{$com['statement_info'][0]['pay_amount']}</td> <td>{$com['statement_info'][0]['pay_amount']}</td>
<td>{$com['statement_info'][0]['pay_amount']}</td> <td>{$com['statement_info'][0]['pay_amount']}</td>
<td>{$com['statement_info'][0]['ratio']}%</td> <td>{$com['statement_info'][0]['ratio']|showNumPercent}</td>
<td>{$com['statement_info'][0]['company_ratio']}%</td> <td>{$com['statement_info'][0]['company_ratio']|showNumPercent}</td>
<td>{$com['statement_info'][0]['promote_ratio']}%</td> <td>{$com['statement_info'][0]['promote_ratio']|showNumPercent}</td>
<td>{$com['statement_info'][0]['fax_ratio']}%</td> <td>{$com['statement_info'][0]['fax_ratio']|showNumPercent}</td>
<td>{$com['statement_info'][0]['d_statement_money']}</td> <td>{$com['statement_info'][0]['d_statement_money']}</td>
<td rowspan="{$com.statement_count}">{$com.fine}</td> <td rowspan="{$com.statement_count}">{$com['fine']-0}</td>
<td rowspan="{$com.statement_count}">{$com.reward}</td> <td rowspan="{$com.statement_count}">{$com['reward']-0}</td>
<td rowspan="{$com.statement_count}">{$com.statement_money}</td> <td rowspan="{$com.statement_count}">{$com['statement_money']-0}</td>
<td rowspan="{$com.statement_count}">{$com.renark}</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}">{$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> </tr>
<foreach name="com.statement_info" item="it" key="k"> <foreach name="com.statement_info" item="it" key="k">
<if condition="$k neq 0"> <if condition="$k neq 0">
<tr> <tr>
<td>{$it['statement_begin_time']} - {$it['statement_end_time']}</td> <td>{$it['statement_begin_time']}-{$it['statement_end_time']}</td>
<td>{$it['game_name']}</td> <td>{$it['game_name']}</td>
<td>{$it['pay_amount']}</td> <td>{$it['pay_amount']}</td>
<td>{$it['pay_amount']}</td> <td>{$it['pay_amount']}</td>
<td>{$it['ratio']}%</td> <td>{$it['ratio']|showNumPercent}</td>
<td>{$it['company_ratio']}%</td> <td>{$it['company_ratio']|showNumPercent}</td>
<td>{$it['promote_ratio']}%</td> <td>{$it['promote_ratio']|showNumPercent}</td>
<td>{$it['fax_ratio']}%</td> <td>{$it['fax_ratio']|showNumPercent}</td>
<td>{$it['d_statement_money']}</td> <td>{$it['d_statement_money']}</td>
</tr> </tr>
</if> </if>
@ -172,6 +209,14 @@
<td>{$count.reward}</td> <td>{$count.reward}</td>
<td>{$count.statement_money}</td> <td>{$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> </tr>
@ -190,5 +235,26 @@
}); });
}); });
</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>

@ -109,7 +109,18 @@
<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> </tr>
</thead> </thead>
<tbody id="statementShow"> <tbody id="statementShow">
@ -119,16 +130,40 @@
<td rowspan="{$com.statement_count}">{$com.company_name}</td> <td rowspan="{$com.statement_count}">{$com.company_name}</td>
<td>{$com['statement_info'][0]['game_name']}</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]['ratio']}%</td> <td>{$com['statement_info'][0]['ratio']|showNumPercent}</td>
<td>{$com['statement_info'][0]['increment_ratio']}%</td> <td>{$com['statement_info'][0]['increment_ratio']|showNumPercent}</td>
<td>{$com['statement_info'][0]['fax_ratio']}%</td> <td>{$com['statement_info'][0]['fax_ratio']|showNumPercent}</td>
<td>{$com['statement_info'][0]['d_statement_money']}</td> <td>{$com['statement_info'][0]['d_statement_money']}</td>
<td rowspan="{$com.statement_count}">{$com.fine}</td> <td rowspan="{$com.statement_count}">{$com['fine']-0}</td>
<td rowspan="{$com.statement_count}">{$com.reward}</td> <td rowspan="{$com.statement_count}">{$com['reward']-0}</td>
<td rowspan="{$com.statement_count}">{$com.statement_money}</td> <td rowspan="{$com.statement_count}">{$com['statement_money']-0}</td>
<td rowspan="{$com.statement_count}">{$com.settlement_contact}</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>{$com['statement_info'][0]['statement_begin_time']}-{$com['statement_info'][0]['statement_end_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}">{$com.renark}</td> <td rowspan="{$com.statement_count}">{$com.renark}</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> </tr>
<foreach name="com.statement_info" item="it" key="k"> <foreach name="com.statement_info" item="it" key="k">
@ -136,11 +171,11 @@
<tr> <tr>
<td>{$it['game_name']}</td> <td>{$it['game_name']}</td>
<td>{$it['pay_amount']}</td> <td>{$it['pay_amount']}</td>
<td>{$it['ratio']}%</td> <td>{$it['ratio']|showNumPercent}</td>
<td>{$it['increment_ratio']}%</td> <td>{$it['increment_ratio']|showNumPercent}</td>
<td>{$it['fax_ratio']}%</td> <td>{$it['fax_ratio']|showNumPercent}</td>
<td>{$it['d_statement_money']}</td> <td>{$it['d_statement_money']}</td>
<td>{$it['statement_begin_time']} - {$it['statement_end_time']}</td> <td>{$it['statement_begin_time']}-{$it['statement_end_time']}</td>
</tr> </tr>
</if> </if>
</foreach> </foreach>
@ -158,6 +193,14 @@
<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>
@ -173,5 +216,26 @@
}); });
}); });
</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>

@ -111,19 +111,14 @@
<th>奖励</th> <th>奖励</th>
<th>罚款</th> <th>罚款</th>
<th>结算金额</th> <th>结算金额</th>
<if condition="$is_payment eq 2">
<th>开户名</th>
<th>银行卡号</th>
<th>开户支行</th>
<th>帐户类型</th>
</if>
<if condition="$is_payment eq 1">
<th>支付宝真实姓名</th>
<th>支付宝账号</th>
</if>
<th>备注</th> <th>户名</th>
<th>帐号</th>
<th>开户行</th>
<th>是否支付宝打款</th>
<th>是否结算</th> <th>是否结算</th>
<th>备注</th>
<if condition="!$is_export"> <if condition="!$is_export">
<th>操作</th> <th>操作</th>
</if> </if>
@ -143,7 +138,7 @@
<td>{$com['statement_info'][0]['game_name']}</td> <td>{$com['statement_info'][0]['game_name']}</td>
<td>{$com['statement_info'][0]['game_type_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]['statement_begin_time']}-{$com['statement_info'][0]['statement_end_time']}</td>
<td>{$com['statement_info'][0]['pay_amount']}</td> <td>{$com['statement_info'][0]['pay_amount']}</td>
<if condition="$com['statement_info'][0]['statement_type'] neq 0"> <if condition="$com['statement_info'][0]['statement_type'] neq 0">
<td></td> <td></td>
@ -157,20 +152,23 @@
<td>{$com['statement_info'][0]['fine']}</td> <td>{$com['statement_info'][0]['fine']}</td>
<td>{$com['statement_info'][0]['sum_money']}</td> <td>{$com['statement_info'][0]['sum_money']}</td>
<if condition="$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.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}">&nbsp;{$com.company_info.bank_account}</td>
<td rowspan="{$com.statement_count}">{$com.company_info.opening_bank}</td> <td rowspan="{$com.statement_count}">{$com.company_info.opening_bank}</td>
<td rowspan="{$com.statement_count}"></td>
</if> </if>
<if condition="$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.statement_count}">{$com.company_info.ali_user}</td>
<td rowspan="{$com.statement_count}">{$com.company_info.ali_account}</td> <td rowspan="{$com.statement_count}">{$com.company_info.ali_account}</td>
<td rowspan="{$com.statement_count}"></td>
</if> </if>
<td rowspan="{$com.statement_count}">{$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}"><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.statement_count}">
<if condition="($com['st'] eq 1 ) AND ($pool_status lt 1)"> <if condition="($com['st'] eq 1 ) AND ($pool_status lt 1)">
@ -188,7 +186,7 @@
<tr> <tr>
<td>{$it['game_name']}</td> <td>{$it['game_name']}</td>
<td>{$it['game_type_name']}</td> <td>{$it['game_type_name']}</td>
<td>{$it['statement_begin_time']} - {$it['statement_end_time']}</td> <td>{$it['statement_begin_time']}-{$it['statement_end_time']}</td>
<td>{$it['pay_amount']}</td> <td>{$it['pay_amount']}</td>
<if condition="$it['statement_type'] neq 0"> <if condition="$it['statement_type'] neq 0">
@ -215,16 +213,10 @@
<td></td> <td></td>
<td></td> <td></td>
<td>{$count.sum_money|default=0}</td> <td>{$count.sum_money|default=0}</td>
<if condition="$is_payment eq 2"> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
</if>
<if condition="$is_payment eq 1">
<td></td>
<td></td>
</if>
<td></td> <td></td>
<td></td> <td></td>
<if condition="!$is_export"> <if condition="!$is_export">

Binary file not shown.

@ -47,6 +47,7 @@ class PHPExcel_Style_NumberFormat extends PHPExcel_Style_Supervisor implements P
const FORMAT_PERCENTAGE = '0%'; const FORMAT_PERCENTAGE = '0%';
const FORMAT_PERCENTAGE_00 = '0.00%'; const FORMAT_PERCENTAGE_00 = '0.00%';
const FORMAT_PERCENTAGE_000 = '0.000%';
const FORMAT_DATE_YYYYMMDD2 = 'yyyy-mm-dd'; const FORMAT_DATE_YYYYMMDD2 = 'yyyy-mm-dd';
const FORMAT_DATE_YYYYMMDD = 'yy-mm-dd'; const FORMAT_DATE_YYYYMMDD = 'yy-mm-dd';

Loading…
Cancel
Save