2.7号功能提交

master
zhengyongxing 4 years ago
parent 3e363d65d5
commit 53ba2c7698

@ -2000,6 +2000,7 @@ function excelUpStreamTemplate($data, $all_sum_money, $all_pay_amount, $big_all_
}
//下游工会对账单导出
function excelSpecialComplementEmplate($data, $all_sum_money, $all_pay_amount, $big_all_sum_money) {
@ -2020,10 +2021,11 @@ function excelSpecialComplementEmplate($data, $all_sum_money, $all_pay_amount, $
$statement_begin_time = date('Y.m.d', $data['statement_begin_time']);//对账开始时间
$statement_end_time = date('Y.m.d',$data['statement_end_time']);//对账截止时间
$objPHPExcel->getActiveSheet()->setCellValue('A1', "《 {$data['company_name']} 》结算单\n{$statement_begin_time}-{$statement_end_time}");
$objPHPExcel->getActiveSheet()->setCellValue('A1', "《 {$data['company_name']} 》特殊补点结算单\n{$statement_begin_time}-{$statement_end_time}");
if ($data['withdraw_type'] == '2') {
$objPHPExcel->getActiveSheet()->setCellValue('D2','补点比例');
}
if ($data['withdraw_type'] == 3) {
$objPHPExcel->getActiveSheet()->setCellValue('E2','特殊补点比例');
}
@ -2054,15 +2056,7 @@ function excelSpecialComplementEmplate($data, $all_sum_money, $all_pay_amount, $
$objPHPExcel->getActiveSheet()->getStyle('E'.$line)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_PERCENTAGE);
$objPHPExcel->getActiveSheet()->getStyle('C'.$line)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER_00);
$objPHPExcel->getActiveSheet()->getStyle('F'.$line)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER_00);
if($data['withdraw_type'] != 3) {
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{
@ -2070,28 +2064,12 @@ function excelSpecialComplementEmplate($data, $all_sum_money, $all_pay_amount, $
}
if($value['fax_ratio'] == 0) $value['fax_ratio'] = 0;
$objPHPExcel->getActiveSheet()->setCellValue('D'.$line, $value['ratio'] . '%');
if ($data['withdraw_type'] == 2) {
$objPHPExcel->getActiveSheet()->setCellValue('D'.$line, $value['increment_ratio'] . '%');
}else{
$objPHPExcel->getActiveSheet()->setCellValue('D'.$line, $value['ratio'] . '%');
}
if ($data['withdraw_type'] != 3) {
$objPHPExcel->getActiveSheet()->setCellValue('E'.$line, $value['fax_ratio'] . '%');
} else {
$objPHPExcel->getActiveSheet()->setCellValue('E'.$line, $value['increment_ratio'] . '%');
}
$objPHPExcel->getActiveSheet()->setCellValue('E'.$line, $value['increment_ratio'] . '%');
$objPHPExcel->getActiveSheet()->setCellValue('C'.$line, $value['pay_amount']);
// $objPHPExcel->getActiveSheet()->setCellValue('F'.$line, $value['sum_money']);
if ($data['withdraw_type'] != 3) {
$objPHPExcel->getActiveSheet()->setCellValue('F'.$line,"=ROUND(C{$line}*D{$line}*(1-E{$line}),2)");
} else {
$objPHPExcel->getActiveSheet()->setCellValue('F'.$line,"=ROUND(C{$line}*E{$line}),2)");
}
$objPHPExcel->getActiveSheet()->setCellValue('F'.$line,"=ROUND(C{$line}*E{$line},2)");
}
$objPHPExcel->getActiveSheet()->setCellValue('B'.$line, $product_name);
$line++;
@ -2120,6 +2098,26 @@ function excelSpecialComplementEmplate($data, $all_sum_money, $all_pay_amount, $
$objPHPExcel->getActiveSheet()->setCellValue('E'.($line+9), $data['receive_company']['bank_account']."\t");//银行账号
$objPHPExcel->getActiveSheet()->setCellValue('E'.($line+10), $data['receive_company']['opening_bank']);//开户行
$height = 20;
$font_size = 44;
if (strlen($data['pay_company']['partner'])<strlen($data['receive_company']['partner'])) {
$partner_height = intval(strlen($data['receive_company']['partner'])/$font_size)+1;
} else {
$partner_height = intval(strlen($data['pay_company']['partner'])/$font_size)+1;
}
$address_height = intval(strlen($data['receive_company']['address'])/$font_size)+1;
$payee_name_height = intval(strlen($data['receive_company']['payee_name'])/$font_size)+1;
$opening_bank_height = intval(strlen($data['receive_company']['opening_bank'])/$font_size)+1;
$objPHPExcel->getActiveSheet()->getStyle("E".($line+3).":E".($line+10))->getAlignment()->setWrapText(true);
$objPHPExcel->getActiveSheet()->getStyle("B".($line+3).":B".($line+7))->getAlignment()->setWrapText(true);
$objPHPExcel->getActiveSheet()->getRowDimension(($line+3))->setRowHeight($height*$partner_height);
$objPHPExcel->getActiveSheet()->getRowDimension(($line+6))->setRowHeight($address_height*$height);
$objPHPExcel->getActiveSheet()->getRowDimension(($line+8))->setRowHeight($payee_name_height*$height);
$objPHPExcel->getActiveSheet()->getRowDimension(($line+10))->setRowHeight($opening_bank_height*$height);
$fileName = "{$data['company_name']}&{$data['my_company']}-对账单{$statement_begin_time}-{$statement_end_time}";
// dd($fileName);
ob_end_clean();//清除缓冲区,避免乱码

@ -1,6 +1,8 @@
<?php
namespace Admin\Controller;
use Base\Factory\BaseFactory;
/**
* 上下游结算单
* @author cz
@ -32,10 +34,17 @@ class CompanyStatementController extends ThinkController
];
public $admininfo;
public $DBModel;
static $specialCompoent;
public function _initialize()
{
$this->admininfo = $_SESSION['onethink_admin']['user_auth'];
$this->DBModel = SM("CompanyStatement","tab_");
$Factory = BaseFactory::getInstance();
self::$specialCompoent = $Factory->factoryClass("SpecialCompoent");
parent::_initialize();
}
public function lists() {
@ -270,6 +279,7 @@ class CompanyStatementController extends ThinkController
"first_part_company"=>$first_party_info['partner'],
"second_part_company"=>$second_party_info['partner'],
"pay_type"=>$dbres['pay_type'],
"is_payment"=>$dbres['is_payment'],
"withdraw_type"=>$dbres['withdraw_type'],//2补丁
"first_party_info"=>$first_party_info,
"second_party_info"=>$second_party_info,
@ -398,12 +408,7 @@ class CompanyStatementController extends ThinkController
// $dbres = $this->DBModel->where("id in ({$ids}) and verify_status = 0")->delete();
$dbres = $this->DBModel->where("id in ({$ids})")->select();
foreach ($dbres as $key=>$value) {
if($value['withdraw_type'] !=3) {
$this->DBModel->where("id = {$value['id']} and verify_status = 0")->delete();
} else {
$this->DBModel->where("id = {$value['id']} and verify_status != 2")->delete();
}
$this->DBModel->where("id = {$value['id']} and verify_status = 0")->delete();
}
addOperationLog(['op_type'=>2,'key'=>$ids,"op_name"=>"删除结算单",'url'=>U('lists')]);
$this->ajaxReturn(array(
@ -484,19 +489,31 @@ class CompanyStatementController extends ThinkController
foreach($dbres as $k=>&$v){
// if(in_array($v['verify_status'],[3,4])) continue; //合作方确认后不进行重算
//重算
$res = A("CompanyStatementSet")->updateCompanyStatementData($v['id'],$this->admininfo["username"]);
if($res === false){
$this->ajaxReturn(array(
'status' => 0,
"info"=>"重算金额错误"
));
if ($v['withdraw_type']!=3) {
$res = A("CompanyStatementSet")->updateCompanyStatementData($v['id'],$this->admininfo["username"]);
if($res === false){
$this->ajaxReturn(array(
'status' => 0,
"info"=>"重算金额错误"
));
}
} else {
$res = self::$specialCompoent->updateSpecialStatement($v['id'],$v['withdraw_type']);
if($res === false){
$this->ajaxReturn(array(
'status' => 0,
"info"=>"重算金额错误"
));
}
}
}
$this->ajaxReturn(array(
'status' => 1,
"info"=>"重算金额成功"
));
}
}
//导出
public function export()
{
@ -565,6 +582,7 @@ class CompanyStatementController extends ThinkController
$dbres=[$dbres];
$this->assign("title","下游个人特殊补点");
$this->assign("is_special_export",true);
$this->exportSpecialComplement($dbres,1);
} else if ($data['withdraw_type'] == 3 && $data['company_type'] != 2){
@ -655,17 +673,6 @@ class CompanyStatementController extends ThinkController
$count['sum_money'] += $val['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){
@ -675,22 +682,15 @@ class CompanyStatementController extends ThinkController
} else {
$v['statement_money'] = substr($v['statement_money'],0,strlen($v['statement_money'])-1).",2)";
}
// dump($v['statement_money']);die();
}
}
// if($is_export){
// $count["platform_amount"] = "=ROUND(SUM(K2:K".$line."),2)";
// $count["sum_money"] = "=ROUND(SUM(Q2:Q".$line."),2)";
// }
if($is_export){
$count["platform_amount"] = "=ROUND(SUM(K2:K".$line."),2)";
$count["week_money"] = "=ROUND(SUM(S2:S".$line."),2)";
$count["sum_money"] = "=ROUND(SUM(T2:T".$line."),2)";
}
$this->assign("withdraw_type",3);
$this->assign("data",$infolist);
$this->assign("count",$count);
$this->assign("is_export",$is_export);
@ -1162,6 +1162,73 @@ class CompanyStatementController extends ThinkController
}
public function checkComplementHistory() {
$data = json_decode($_REQUEST['data'],true);
$return_data = [];
foreach ($data as $dkey => $dval) {
$check_add = $this->DBModel->field("statement_begin_time,statement_end_time,statement_info,company_type")->where(['company_id'=>$dval['company_id'],'withdraw_type'=>3])->select();
$start_time = strtotime($dval['statement_begin_time']);
$end_time = strtotime($dval['statement_end_time']) + 86399;
$relation_game_data = array_column($dval['statement_info'],'relation_game_id');
foreach ($check_add as $key => $value) {
$statementInfo = json_decode($value['statement_info'],true);;
if ($value['company_type'] == 2) {
foreach ($statementInfo as $sk => $sv) {
$statementInfos = $sv['game_list'];
foreach ($statementInfos as $k => $v) {
if (strtotime(str_replace('.','-',$v['statement_end_time'])) >= $start_time && strtotime(str_replace('.','-',$v['statement_end_time']))<=$end_time
||strtotime(str_replace('.','-',$v['statement_begin_time']))>=$start_time && strtotime(str_replace('.','-',$v['statement_begin_time']))<=$end_time
||strtotime(str_replace('.','-',$v['statement_begin_time']))<=$start_time && strtotime(str_replace('.','-',$v['statement_end_time'])) >= $end_time) {
if (!in_array($v['game_name'], $return_data[$dval['company_name']])) {
$return_data[$dval['company_name']][]=$v['game_name'];
}
}
}
}
} else {
foreach ($statementInfo as $k => $v) {
if (strtotime(str_replace('.','-',$v['statement_end_time'])) >= $start_time && strtotime(str_replace('.','-',$v['statement_end_time']))<=$end_time
||strtotime(str_replace('.','-',$v['statement_begin_time']))>=$start_time && strtotime(str_replace('.','-',$v['statement_begin_time']))<=$end_time
||strtotime(str_replace('.','-',$v['statement_begin_time']))<=$start_time && strtotime(str_replace('.','-',$v['statement_end_time'])) >= $end_time) {
if (!in_array($v['game_name'], $return_data[$dval['company_name']])) {
$return_data[$dval['company_name']][]=$v['game_name'];
}
}
}
}
}
}
$return_str = "";
foreach ($return_data as $key => $value) {
$return_str .= "[{$key}]";
}
if (!$return_data) {
$this->ajaxReturn(['status' => 0, 'data' => $return_str]);
} else {
$this->ajaxReturn(['status' => 1, 'data' => $return_str]);
}
}
public function addSpecialComplement() {
$map = [];
@ -1195,46 +1262,47 @@ class CompanyStatementController extends ThinkController
$start_time = strtotime($_REQUEST['time_start']);
$end_time = strtotime($_REQUEST['time_end']) + 86399;
$check_add = $this->DBModel->field("statement_begin_time,statement_end_time,statement_info,company_type")->where(['company_id'=>$_REQUEST['company_id'],'withdraw_type'=>3])->select();
foreach ($check_add as $key => $value) {
// if ($value['statement_end_time'] >= $start_time && $value['statement_end_time']<=$end_time
// ||$value['statement_begin_time']>=$start_time && $value['statement_begin_time']<=$end_time
// ||$value['statement_begin_time']<=$start_time && $value['statement_end_time'] >= $end_time)
// {
$statementInfo = json_decode($value['statement_info'],true);;
if ($value['company_type'] == 2) {
foreach ($statementInfo as $sk => $sv) {
$statementInfos = $sv['game_list'];
foreach ($statementInfos as $k => $v) {
if (strtotime(str_replace('.','-',$v['statement_end_time'])) >= $start_time && strtotime(str_replace('.','-',$v['statement_end_time']))<=$end_time
||strtotime(str_replace('.','-',$v['statement_begin_time']))>=$start_time && strtotime(str_replace('.','-',$v['statement_begin_time']))<=$end_time
||strtotime(str_replace('.','-',$v['statement_begin_time']))<=$start_time && strtotime(str_replace('.','-',$v['statement_end_time'])) >= $end_time) {
if (in_array($v['relation_game_id'], $relation_game_data)) {
$this->ajaxReturn(['status' => 0, 'data' => [], 'msg' => "《{$v['game_name']}》在日期:{$_REQUEST['time_start']}-{$_REQUEST['time_end']}有结算过的部分,请重新选择"]);
}
}
}
}
} else {
foreach ($statementInfo as $k => $v) {
if (strtotime(str_replace('.','-',$v['statement_end_time'])) >= $start_time && strtotime(str_replace('.','-',$v['statement_end_time']))<=$end_time
||strtotime(str_replace('.','-',$v['statement_begin_time']))>=$start_time && strtotime(str_replace('.','-',$v['statement_begin_time']))<=$end_time
||strtotime(str_replace('.','-',$v['statement_begin_time']))<=$start_time && strtotime(str_replace('.','-',$v['statement_end_time'])) >= $end_time) {
if (in_array($v['relation_game_id'], $relation_game_data)) {
$this->ajaxReturn(['status' => 0, 'data' => [], 'msg' => "《{$v['game_name']}》在日期:{$_REQUEST['time_start']}-{$_REQUEST['time_end']}有结算过的部分,请重新选择"]);
}
}
}
}
// $check_add = $this->DBModel->field("statement_begin_time,statement_end_time,statement_info,company_type")->where(['company_id'=>$_REQUEST['company_id'],'withdraw_type'=>3])->select();
//
// foreach ($check_add as $key => $value) {
//
//// if ($value['statement_end_time'] >= $start_time && $value['statement_end_time']<=$end_time
//// ||$value['statement_begin_time']>=$start_time && $value['statement_begin_time']<=$end_time
//// ||$value['statement_begin_time']<=$start_time && $value['statement_end_time'] >= $end_time)
//// {
//
// $statementInfo = json_decode($value['statement_info'],true);;
// if ($value['company_type'] == 2) {
//
// foreach ($statementInfo as $sk => $sv) {
// $statementInfos = $sv['game_list'];
// foreach ($statementInfos as $k => $v) {
// if (strtotime(str_replace('.','-',$v['statement_end_time'])) >= $start_time && strtotime(str_replace('.','-',$v['statement_end_time']))<=$end_time
// ||strtotime(str_replace('.','-',$v['statement_begin_time']))>=$start_time && strtotime(str_replace('.','-',$v['statement_begin_time']))<=$end_time
// ||strtotime(str_replace('.','-',$v['statement_begin_time']))<=$start_time && strtotime(str_replace('.','-',$v['statement_end_time'])) >= $end_time) {
// if (in_array($v['relation_game_id'], $relation_game_data)) {
// $this->ajaxReturn(['status' => 0, 'data' => [], 'msg' => "《{$v['game_name']}》在日期:{$_REQUEST['time_start']}-{$_REQUEST['time_end']}有结算过的部分,请重新选择"]);
// }
// }
// }
// }
// } else {
// foreach ($statementInfo as $k => $v) {
// if (strtotime(str_replace('.','-',$v['statement_end_time'])) >= $start_time && strtotime(str_replace('.','-',$v['statement_end_time']))<=$end_time
// ||strtotime(str_replace('.','-',$v['statement_begin_time']))>=$start_time && strtotime(str_replace('.','-',$v['statement_begin_time']))<=$end_time
// ||strtotime(str_replace('.','-',$v['statement_begin_time']))<=$start_time && strtotime(str_replace('.','-',$v['statement_end_time'])) >= $end_time) {
// if (in_array($v['relation_game_id'], $relation_game_data)) {
// $this->ajaxReturn(['status' => 0, 'data' => [], 'msg' => "《{$v['game_name']}》在日期:{$_REQUEST['time_start']}-{$_REQUEST['time_end']}有结算过的部分,请重新选择"]);
// }
// }
// }
// }
}
//
//
//// }
//
// }
if (isset($_REQUEST['time_start']) && isset($_REQUEST['time_end'])) {
@ -1286,9 +1354,12 @@ class CompanyStatementController extends ThinkController
$handleRadioData[$value['relation_game_id']] = $value['relation_game_name'];
}
$relationWhere = '(first_company_type=2 and first_company_id=' . $_REQUEST['company_id'] .
') or (second_company_type=2 and second_company_id=' . $_REQUEST['company_id'] . ')';
$relation = M('company_relation', 'tab_')->where($relationWhere)->find();
$companyData = M("promote_company","tab_")
->field("company_name")
->field("company_name,ali_user,ali_account,bank_address,bank_card,bank_name")
->where(['id'=>$_REQUEST['company_id']])
->find();
@ -1303,6 +1374,15 @@ class CompanyStatementController extends ThinkController
->find();
$handleData[$_REQUEST['company_id']]['company_id'] = $_REQUEST['company_id'];
$handleData[$_REQUEST['company_id']]['is_payment'] = $relation['is_payment'];
$handleData[$_REQUEST['company_id']]['ali_user'] = $companyData['ali_user'];
$handleData[$_REQUEST['company_id']]['ali_account'] = $companyData['ali_account'];
$handleData[$_REQUEST['company_id']]['payee_name'] = $companyData['bank_address'];
$handleData[$_REQUEST['company_id']]['bank_account'] = $companyData['bank_card'];
$handleData[$_REQUEST['company_id']]['opening_bank'] = $companyData['bank_name'];
$handleData[$_REQUEST['company_id']]['company_name'] = $companyData['company_name'];
$handleData[$_REQUEST['company_id']]['begin_time'][] = strtotime(I('time_start'));
$handleData[$_REQUEST['company_id']]['end_time'][] = strtotime(I('time_end')) + 86399;
@ -1336,6 +1416,18 @@ class CompanyStatementController extends ThinkController
$handleData[$_REQUEST['company_id']]['end_time'][] = strtotime(I('time_end')) + 86399;
}
$handleData[$_REQUEST['company_id']]['company_id'] = $_REQUEST['company_id'];
$handleData[$_REQUEST['company_id']]['is_payment'] = $relation['is_payment'];
if ($relation['is_payment'] == 1) {
$handleData[$_REQUEST['company_id']]['payee_name'] = $companyData['ali_user'];
$handleData[$_REQUEST['company_id']]['bank_account'] = $companyData['ali_account'];
$handleData[$_REQUEST['company_id']]['opening_bank'] = '';
} else {
$handleData[$_REQUEST['company_id']]['payee_name'] = $companyData['bank_address'];
$handleData[$_REQUEST['company_id']]['bank_account'] = $companyData['bank_card'];
$handleData[$_REQUEST['company_id']]['opening_bank'] = $companyData['bank_name'];
}
$handleData[$_REQUEST['company_id']]['company_name'] = $companyData['company_name'];
$handleData[$_REQUEST['company_id']]['relation_game_id'][] = $value['relation_game_id'];
$handleData[$_REQUEST['company_id']]['relation_game_name'][] = $value['relation_game_name'];
@ -1347,6 +1439,18 @@ class CompanyStatementController extends ThinkController
if ($key == 0) {
if (strtotime(I('time_start')) < $value['begin_time']) {
$handleData[$_REQUEST['company_id']]['company_id'] = $_REQUEST['company_id'];
$handleData[$_REQUEST['company_id']]['is_payment'] = $relation['is_payment'];
if ($relation['is_payment'] == 1) {
$handleData[$_REQUEST['company_id']]['payee_name'] = $companyData['ali_user'];
$handleData[$_REQUEST['company_id']]['bank_account'] = $companyData['ali_account'];
$handleData[$_REQUEST['company_id']]['opening_bank'] = '';
} else {
$handleData[$_REQUEST['company_id']]['payee_name'] = $companyData['bank_address'];
$handleData[$_REQUEST['company_id']]['bank_account'] = $companyData['bank_card'];
$handleData[$_REQUEST['company_id']]['opening_bank'] = $companyData['bank_name'];
}
$handleData[$_REQUEST['company_id']]['company_name'] = $companyData['company_name'];
$handleData[$_REQUEST['company_id']]['begin_time'][] = strtotime(I('time_start'));
$handleData[$_REQUEST['company_id']]['end_time'][] = $value['begin_time']-1;
@ -1362,6 +1466,18 @@ class CompanyStatementController extends ThinkController
if (strtotime(I('time_end')) > $value['end_time'] && $value['end_time']!=0) {
$handleData[$_REQUEST['company_id']]['company_id'] = $_REQUEST['company_id'];
$handleData[$_REQUEST['company_id']]['is_payment'] = $relation['is_payment'];
if ($relation['is_payment'] == 1) {
$handleData[$_REQUEST['company_id']]['payee_name'] = $companyData['ali_user'];
$handleData[$_REQUEST['company_id']]['bank_account'] = $companyData['ali_account'];
$handleData[$_REQUEST['company_id']]['opening_bank'] = '';
} else {
$handleData[$_REQUEST['company_id']]['payee_name'] = $companyData['bank_address'];
$handleData[$_REQUEST['company_id']]['bank_account'] = $companyData['bank_card'];
$handleData[$_REQUEST['company_id']]['opening_bank'] = $companyData['bank_name'];
}
$handleData[$_REQUEST['company_id']]['company_name'] = $companyData['company_name'];
$handleData[$_REQUEST['company_id']]['begin_time'][] = $value['end_time'] + 1;
$handleData[$_REQUEST['company_id']]['end_time'][] = strtotime(I('time_end'))-86399;
@ -1376,6 +1492,18 @@ class CompanyStatementController extends ThinkController
if ($radioData[$key+1]) {
if ($radioData[$key+1]['begin_time'] != ($value['end_time']+1)&&$value['end_time']!=0) {
$handleData[$_REQUEST['company_id']]['company_id'] = $_REQUEST['company_id'];
$handleData[$_REQUEST['company_id']]['is_payment'] = $relation['is_payment'];
if ($relation['is_payment'] == 1) {
$handleData[$_REQUEST['company_id']]['payee_name'] = $companyData['ali_user'];
$handleData[$_REQUEST['company_id']]['bank_account'] = $companyData['ali_account'];
$handleData[$_REQUEST['company_id']]['opening_bank'] = '';
} else {
$handleData[$_REQUEST['company_id']]['payee_name'] = $companyData['bank_address'];
$handleData[$_REQUEST['company_id']]['bank_account'] = $companyData['bank_card'];
$handleData[$_REQUEST['company_id']]['opening_bank'] = $companyData['bank_name'];
}
$handleData[$_REQUEST['company_id']]['company_name'] = $companyData['company_name'];
$handleData[$_REQUEST['company_id']]['begin_time'][] = $value['end_time'] + 1;
$handleData[$_REQUEST['company_id']]['end_time'][] = $radioData[$key+1]['begin_time'] - 1;
@ -1437,7 +1565,6 @@ class CompanyStatementController extends ThinkController
}
$this->ajaxReturn(['status'=>1,'data'=>$handleData,'msg'=>'']);
}
@ -1466,15 +1593,15 @@ class CompanyStatementController extends ThinkController
$begin_time = 99999999999;
$end_time = 0;
$statement_data = [];
$company_data = M("promote_company","tab_")->where(['id'=>$value['company_id']])->find();
// dump($company_data);die();
$company_type = M("company_relation","tab_")
->where("(first_company_id={$value['company_id']} and first_company_type =2) or (second_company_id={$value['company_id']} and second_company_type=2)")
->find();
$company_type = M("company_relation","tab_")->where("first_company_id={$value['company_id']} or second_company_id={$value['company_id']}")->find();
$insert['is_payment'] = $value['is_payment'];
$insert['is_payment'] = $company_type['is_payment'];
// $insert['statement_begin_time'] = strtotime($value['statement_begin_time']);
// $insert['statement_end_time'] = strtotime($value['statement_end_time']);
$insert['withdraw_type'] = $withdraw_type;
$insert['company_belong'] = $company_data['company_belong'];
$insert['company_name'] = $company_data['company_name'];
@ -1488,18 +1615,18 @@ class CompanyStatementController extends ThinkController
$proCompany_info['link_man'] = $company_data['settlement_contact'];
$proCompany_info['link_phone'] =$company_data['contact_phone'];
$proCompany_info['address'] = $company_data['address'];
$proCompany_info['payee_name'] =$company_data['bank_address'];
$proCompany_info['payee_name'] =$value['payee_name'];
$proCompany_info['bank_account'] = $company_data['bank_card'];
$proCompany_info['opening_bank'] =$company_data['bank_name'];
$proCompany_info['bank_account'] = $value['bank_account'];
$proCompany_info['opening_bank'] =$value['opening_bank'];
$proCompany_info['fax_ratio'] = $company_data['fax_ratio'];
$proCompany_info['taxation_rate'] = $company_data['taxation_rate'];
$proCompany_info['company_belong'] = $company_data['company_belong'];
$proCompany_info['company_type'] = $company_data['company_type'];
$proCompany_info['develop_type'] = $company_data['develop_type'];
$proCompany_info['ali_user'] = $company_data['ali_user'];
$proCompany_info['ali_account'] =$company_data['ali_account'];
$proCompany_info['ali_user'] = $value['ali_user'];
$proCompany_info['ali_account'] =$value['ali_account'];
$proCompany_info['has_server_fee'] = $company_data['has_server_fee'];
$proCompany_info['server_fee'] =$company_data['server_fee'];
@ -1605,7 +1732,7 @@ class CompanyStatementController extends ThinkController
$game_list['game_name'] = $aval['relation_game_name'];
$game_list['game_type_name'] = $aval['game_type_name'];
$game_list['ratio'] = $v['ratio'];
$game_list['ratio'] = floatval($v['ratio']);
$game_list['fax_ratio'] = $company_data['fax_ratio'];
$game_list['sum_money'] = ($aval['pay_amount']*($v['increment_ratio']))/100;
$game_list['increment_ratio'] = $v['increment_ratio'];
@ -1712,9 +1839,9 @@ class CompanyStatementController extends ThinkController
$optist = array_diff($optist, ["addRemark"]);
}
if ($withdraw_type == 3) {
$optist = array_diff($optist, ["editStatement"]);
}
// if ($withdraw_type == 3) {
// $optist = array_diff($optist, ["editStatement"]);
// }
$resarr = [];
foreach ($optist as $k => $v) {

@ -2153,12 +2153,21 @@ class CompanyStatementPoolController extends ThinkController
if ($info['company_type'] == 2 && $info['verify_status'] == '0') {
array_push($optist,'editSpecialPuPool');
}
}
if(($info['verify_status'] == '6' || $info['verify_status'] == '0') &&!($info['company_type'] == 2 && $info['withdraw_type'] == "特殊补点")) {
array_push($optist,"editPool");
}
if ($info['withdraw_type'] == "特殊补点") {
$optist = array_diff($optist, ["cancelPool"]);
if ($info['verify_status'] == '0') {
array_push($optist,"cancelPool");
}
}
if(empty($info['ext_file'])){
//未上传凭证
$optist = array_diff($optist, ["viewVoucher", "editVoucher"]);

@ -234,24 +234,26 @@
<div class="tab-content tabcon1711" id="skf_payinfo">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="l">收款方名称:</td>
<td class="r">
<input type="text" class="txt" name="" disabled="disabled" placeholder="" value="{$data.payinfo.payee_name}">
</td>
</tr>
<tr>
<td class="l">银行账号:</td>
<td class="r">
<input type="text" class="txt" name="" value="{$data.payinfo.bank_account}" disabled="disabled" placeholder="">
</td>
</tr>
<tr>
<td class="l"><if condition="$data['is_payment'] eq 2">收款方名称:<elseif condition="$data['is_payment'] eq 1"/>支付宝真实姓名:</if></td>
<td class="r">
<input type="text" class="txt normalchange" data-change="${type}.payee_name" name="payee_name" placeholder="" <if condition="$data['is_payment'] eq 2">value="${party_info.payee_name}"<elseif condition="$data['is_payment'] eq 1"/>value="${party_info.ali_user}"</if>>
</td>
</tr>
<tr>
<td class="l"><if condition="$data['is_payment'] eq 2">银行账号:<elseif condition="$data['is_payment'] eq 1"/>支付宝账号:</if></td>
<td class="r">
<input type="text" class="txt normalchange" data-change="${type}.bank_account" name="bank_account" <if condition="$data['is_payment'] eq 2">value="${party_info.bank_account}"<elseif condition="$data['is_payment'] eq 1"/>value="${party_info.ali_account}"</if> placeholder="">
</td>
</tr>
<if condition="$data['is_payment'] eq 2">
<tr>
<td class="l">开户行:</td>
<td class="r">
<input type="text" class="txt" name="password" value="{$data.payinfo.opening_bank}" disabled="disabled" placeholder="请先选择支付给谁">
<input type="text" class="txt normalchange" data-change="${type}.opening_bank" name="opening_bank" value="${party_info.opening_bank}" placeholder="请先选择支付给谁">
</td>
</tr>
</if>
</tbody>
</table>
</div>
@ -317,24 +319,26 @@
<div class="tab-content tabcon1711" id="skf_payinfo">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="l">收款方名称:</td>
<td class="r">
<input type="text" class="txt normalchange" data-change="${type}.payee_name" name="payee_name" placeholder="" value="${party_info.payee_name}">
</td>
</tr>
<tr>
<td class="l">银行账号:</td>
<td class="r">
<input type="text" class="txt normalchange" data-change="${type}.bank_account" name="bank_account" value="${party_info.bank_account}" placeholder="">
</td>
</tr>
<tr>
<td class="l"><if condition="$data['is_payment'] eq 2">收款方名称:<elseif condition="$data['is_payment'] eq 1"/>支付宝真实姓名:</if></td>
<td class="r">
<input type="text" class="txt normalchange" placeholder="" <if condition="$data['is_payment'] eq 2"> data-change="${type}.payee_name" name="payee_name" value="${party_info.payee_name}"<elseif condition="$data['is_payment'] eq 1"/>value="${party_info.ali_user}" data-change="${type}.ali_user" name="ali_user" </if>>
</td>
</tr>
<tr>
<td class="l"><if condition="$data['is_payment'] eq 2">银行账号:<elseif condition="$data['is_payment'] eq 1"/>支付宝账号:</if></td>
<td class="r">
<input type="text" class="txt normalchange" <if condition="$data['is_payment'] eq 2"> data-change="${type}.bank_account" name="bank_account" value="${party_info.bank_account}"<elseif condition="$data['is_payment'] eq 1"/>value="${party_info.ali_account}" data-change="${type}.ali_account" name="ali_account"</if> placeholder="">
</td>
</tr>
<if condition="$data['is_payment'] eq 2">
<tr>
<td class="l">开户行:</td>
<td class="r">
<input type="text" class="txt normalchange" data-change="${type}.opening_bank" name="opening_bank" value="${party_info.opening_bank}" placeholder="请先选择支付给谁">
<input type="text" class="txt normalchange" data-change="${type}.opening_bank" name="opening_bank" value="${party_info.opening_bank}" placeholder="请先选择支付给谁">
</td>
</tr>
</if>
</tbody>
</table>
</div>

@ -236,23 +236,25 @@
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="l">收款方名称:</td>
<td class="l"><if condition="$data['is_payment'] eq 2">收款方名称:<elseif condition="$data['is_payment'] eq 1"/>支付宝真实姓名:</if></td>
<td class="r">
<input type="text" class="txt" name="" disabled="disabled" placeholder="" value="{$data.payinfo.payee_name}">
<input type="text" class="txt" name="" disabled="disabled" placeholder="" <if condition="$data['is_payment'] eq 2">value="{$data.payinfo.payee_name}"<elseif condition="$data['is_payment'] eq 1"/>value="{$data.payinfo.ali_user}"</if>>
</td>
</tr>
<tr>
<td class="l">银行账号:</td>
<td class="l"><if condition="$data['is_payment'] eq 2">银行账号:<elseif condition="$data['is_payment'] eq 1"/>支付宝账号:</if></td>
<td class="r">
<input type="text" class="txt" name="" value="{$data.payinfo.bank_account}" disabled="disabled" placeholder="">
</td>
</tr>
<tr>
<td class="l">开户行:</td>
<td class="r">
<input type="text" class="txt" name="password" value="{$data.payinfo.opening_bank}" disabled="disabled" placeholder="请先选择支付给谁">
<input type="text" class="txt" name="" <if condition="$data['is_payment'] eq 2">value="{$data.payinfo.bank_account}"<elseif condition="$data['is_payment'] eq 1"/>value="{$data.payinfo.ali_account}"</if> disabled="disabled" placeholder="">
</td>
</tr>
<if condition="$data['is_payment'] eq 2">
<tr>
<td class="l">开户行:</td>
<td class="r">
<input type="text" class="txt" name="password" value="{$data.payinfo.opening_bank}" disabled="disabled" placeholder="请先选择支付给谁">
</td>
</tr>
</if>
</tbody>
</table>
</div>
@ -319,23 +321,25 @@
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="l">收款方名称:</td>
<td class="l"><if condition="$data['is_payment'] eq 2">收款方名称:<elseif condition="$data['is_payment'] eq 1"/>支付宝真实姓名:</if></td>
<td class="r">
<input type="text" class="txt normalchange" data-change="${type}.payee_name" name="payee_name" placeholder="" value="${party_info.payee_name}">
<input type="text" class="txt normalchange" placeholder="" <if condition="$data['is_payment'] eq 2"> data-change="${type}.payee_name" name="payee_name" value="${party_info.payee_name}"<elseif condition="$data['is_payment'] eq 1"/> data-change="${type}.ali_user" name="ali_user" value="${party_info.ali_user}"</if>>
</td>
</tr>
<tr>
<td class="l">银行账号:</td>
<td class="l"><if condition="$data['is_payment'] eq 2">银行账号:<elseif condition="$data['is_payment'] eq 1"/>支付宝账号:</if></td>
<td class="r">
<input type="text" class="txt normalchange" data-change="${type}.bank_account" name="bank_account" value="${party_info.bank_account}" placeholder="">
</td>
</tr>
<tr>
<td class="l">开户行:</td>
<td class="r">
<input type="text" class="txt normalchange" data-change="${type}.opening_bank" name="opening_bank" value="${party_info.opening_bank}" placeholder="请先选择支付给谁">
<input type="text" class="txt normalchange" <if condition="$data['is_payment'] eq 2">data-change="${type}.bank_account" name="bank_account" value="${party_info.bank_account}"<elseif condition="$data['is_payment'] eq 1"/>data-change="${type}.ali_account" name="ali_account" value="${party_info.ali_account}"</if> placeholder="">
</td>
</tr>
<if condition="$data['is_payment'] eq 2">
<tr>
<td class="l">开户行:</td>
<td class="r">
<input type="text" class="txt normalchange" data-change="${type}.opening_bank" name="opening_bank" value="${party_info.opening_bank}" placeholder="请先选择支付给谁">
</td>
</tr>
</if>
</tbody>
</table>
</div>
@ -391,11 +395,11 @@
{@if it['game_list'][0]['statement_type']==0}
{@if withdraw_type==2}
<td><input type="text" class="txt statementchange" name="fax_ratio" data-index ="${index}" data-change="statement_info[${index}]['game_list'][0]['fax_ratio']" value="${it['game_list'][0]['fax_ratio']}" style="width: 40px;">%</td>
<td><input type="text" class="txt statementchange" name="fax_ratio" data-index ="${index}" data-secindex ="0" data-change="statement_info[${index}]['game_list'][0]['fax_ratio']" value="${it['game_list'][0]['fax_ratio']}" style="width: 40px;">%</td>
{@else}
<td><input type="text" class="txt statementchange" name="ratio" data-index ="${index}" data-change="statement_info[${index}]['game_list'][0]['ratio']" value="${it['game_list'][0]['ratio']}" style="width: 40px;" disabled="disabled">%</td>
<td><input type="text" class="txt statementchange" name="ratio" data-index ="${index}" data-secindex ="0" data-change="statement_info[${index}]['game_list'][0]['ratio']" value="${it['game_list'][0]['ratio']}" style="width: 40px;" disabled="disabled">%</td>
{@/if}
<td><input type="text" class="txt statementchange" name="increment_ratio" data-index ="${index}" data-change="statement_info[${index}]['game_list'][0]['increment_ratio']" value="${it['game_list'][0]['increment_ratio']}" style="width: 40px;">%</td>
<td><input type="text" class="txt statementchange" name="increment_ratio" data-index ="${index}" data-secindex ="0" data-change="statement_info[${index}]['game_list'][0]['increment_ratio']" value="${it['game_list'][0]['increment_ratio']}" style="width: 40px;">%</td>
{@else}
<td></td>
<td></td>
@ -421,11 +425,11 @@
{@/if}
{@if it_g['statement_type']==0}
{@if withdraw_type==2}
<td><input type="text" class="txt statementchange" name="fax_ratio" data-index ="${index}" data-change="it_g['fax_ratio']" value="${it_g['fax_ratio']}" style="width: 40px;">%</td>
<td><input type="text" class="txt statementchange" name="fax_ratio" data-index ="${index}" data-secindex ="${index_g}" data-change="statement_info[${index}]['game_list'][${index_g}]['fax_ratio']" value="${it_g['fax_ratio']}" style="width: 40px;">%</td>
{@else}
<td><input type="text" class="txt statementchange" name="ratio" data-index ="${index}" data-change="it_g['ratio']" value="${it_g['ratio']}" style="width: 40px;" disabled="disabled">%</td>
<td><input type="text" class="txt statementchange" name="ratio" data-index ="${index}" data-secindex ="${index_g}" data-change="statement_info[${index}]['game_list'][${index_g}]['ratio']" value="${it_g['ratio']}" style="width: 40px;" disabled="disabled">%</td>
{@/if}
<td><input type="text" class="txt statementchange" name="increment_ratio" data-index ="${index}" data-change="it_g['increment_ratio']" value="${it_g['increment_ratio']}" style="width: 40px;">%</td>
<td><input type="text" class="txt statementchange" name="increment_ratio" data-index ="${index}" data-secindex ="${index_g}" data-change="statement_info[${index}]['game_list'][${index_g}]['increment_ratio']" value="${it_g['increment_ratio']}" style="width: 40px;">%</td>
{@else}
<td></td>
<td></td>
@ -571,6 +575,7 @@
$(".statementchange").on("blur",function(){
var sort = $(this).data("change");
var val = $(this).val();
var vdata = eval("DATAOBJ."+sort);//原先值
var dom = $(this);
@ -589,30 +594,25 @@
}
eval(str);
var index = $(this).data("index");
var td = DATAOBJ.statement_info[index];
var secindex = $(this).data("secindex");
var td = DATAOBJ.statement_info[index].game_list[secindex];
var withdraw_type = DATAOBJ['withdraw_type'];
var rname = $(this).attr("name");
var ratio = 0;
if( rname == "fax_ratio" || rname == "ratio"){
if( rname == "fax_ratio" || rname == "ratio" || rname == "increment_ratio" ){
ratio = val;
}else{
ratio = td['ratio'];
}
var gamelist = td['game_list'];
td['sum_money'] = 0;
for (var item in gamelist) {
td['sum_money'] += (gamelist[item]['pay_amount'] * parseInt(val))/100;
console.log(td['sum_money'])
DATAOBJ.statement_money = PUBLIC.floatCut(DATAOBJ.statement_money,td['sum_money']);
if (withdraw_type == 3) {
td['sum_money'] = td['pay_amount']*ratio/100;
} else {
td['sum_money'] = Math.round(td['pay_amount']*ratio*(100-td['fax_ratio'])/100,2)/100;
}
console.log(td['sum_money']);return
DATAOBJ.statement_money = PUBLIC.floatCut(DATAOBJ.statement_money,td['sum_money']);
td['sum_money'] = td['pay_amount']*(parseFloat(ratio))/100;
td['sum_money'] = (td['sum_money']).toFixed(2);
DATAOBJ.statement_money=PUBLIC.floatAdd(DATAOBJ.statement_money,td['sum_money']);
TPLSHOW.showStatementList(true);

@ -486,7 +486,7 @@
}else if(id=="delStatement"){
var opname = "批量删除";
var opurl = "{:U('delStatement')}";
var opst ="[未进行审批,特殊补点(除汇总状态)]";
var opst ="[未进行审批]";
var status = [0];
var confirm = true;
}
@ -494,11 +494,13 @@
var flag = false;
var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) {
if (id=="delStatement"&&$(elem).data("type")==3&&$(elem).data("status") == 2) {
flag = true;
}
// if (id=="delStatement"&&$(elem).data("type")==3&&$(elem).data("status") == 0) {
// return $(elem).val();
// } else if(id=="delStatement"&&$(elem).data("type")==3&&$(elem).data("status") == 2) {
// flag = true;
// }
if($.inArray( $(elem).data("status"),status) == -1||(id=="updateStatement" && $(elem).data("type")==3)){
if($.inArray( $(elem).data("status"),status) == -1){
flag = true;
}else{
return $(elem).val();
@ -514,7 +516,7 @@
return;
}
text = text.join(",");
console.log(text);
// console.log(text);
if(flag){
layer.confirm(opname+"仅会对"+opst+"的申请进行处理,选择中包含其他的状态的申请将被忽略,点击取消停止操作",{title:false}, function(index){
layer.close(index);

@ -267,25 +267,47 @@
<div id="partpatinfo" style="display: flex;margin: auto;">
<div class="tab-content tabcon1711" id="skf_payinfo">
<table border="0" cellspacing="0" cellpadding="0">
<!-- <tbody>-->
<!-- <tr>-->
<!-- <td class="l">收款方名称:</td>-->
<!-- <td class="r">-->
<!-- <input type="text" class="txt" name="" disabled="disabled" placeholder="" value="{$data.payinfo.payee_name}">-->
<!-- </td>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <td class="l">银行账号:</td>-->
<!-- <td class="r">-->
<!-- <input type="text" class="txt" name="" value="{$data.payinfo.bank_account}" disabled="disabled" placeholder="">-->
<!-- </td>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <td class="l">开户行:</td>-->
<!-- <td class="r">-->
<!-- <input type="text" class="txt" name="password" value="{$data.payinfo.opening_bank}" disabled="disabled" placeholder="请先选择支付给谁">-->
<!-- </td>-->
<!-- </tr>-->
<!-- </tbody>-->
<tbody>
<tr>
<td class="l">收款方名称:</td>
<td class="r">
<input type="text" class="txt" name="" disabled="disabled" placeholder="" value="{$data.payinfo.payee_name}">
</td>
</tr>
<tr>
<td class="l">银行账号:</td>
<td class="r">
<input type="text" class="txt" name="" value="{$data.payinfo.bank_account}" disabled="disabled" placeholder="">
</td>
</tr>
<tr>
<td class="l"><if condition="$data['is_payment'] eq 2">收款方名称:<elseif condition="$data['is_payment'] eq 1"/>支付宝真实姓名:</if></td>
<td class="r">
<input type="text" class="txt" name="" disabled="disabled" placeholder="" <if condition="$data['is_payment'] eq 2">value="{$data.payinfo.payee_name}"<elseif condition="$data['is_payment'] eq 1"/>value="{$data.payinfo.ali_user}"</if>>
</td>
</tr>
<tr>
<td class="l"><if condition="$data['is_payment'] eq 2">银行账号:<elseif condition="$data['is_payment'] eq 1"/>支付宝账号:</if></td>
<td class="r">
<input type="text" class="txt" name="" disabled="disabled" placeholder="" <if condition="$data['is_payment'] eq 2">value="{$data.payinfo.bank_account}"<elseif condition="$data['is_payment'] eq 1"/>value="{$data.payinfo.ali_account}"</if> placeholder="">
</td>
</tr>
<if condition="$data['is_payment'] eq 2">
<tr>
<td class="l">开户行:</td>
<td class="r">
<input type="text" class="txt" name="password" value="{$data.payinfo.opening_bank}" disabled="disabled" placeholder="请先选择支付给谁">
<input type="text" class="txt" name="password" value="{$data.payinfo.opening_bank}" disabled="disabled" placeholder="请先选择支付给谁">
</td>
</tr>
</if>
</tbody>
</table>
</div>

@ -196,18 +196,19 @@
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="l">开户名:</td>
<td class="l"><if condition="$data['is_payment'] eq 2">开户名:<elseif condition="$data['is_payment'] eq 1"/>支付宝真实姓名:</if></td>
<td class="r">
<input type="text" class="txt" name="" disabled="disabled" placeholder="" value="{$data.payinfo.payee_name}">
</td>
</tr>
<tr>
<td class="l">开户支行:</td>
<td class="r">
<input type="text" class="txt" name="password" value="{$data.payinfo.opening_bank}" disabled="disabled">
<input type="text" class="txt" name="" disabled="disabled" placeholder="" <if condition="$data['is_payment'] eq 2">value="{$data.payinfo.payee_name}"<elseif condition="$data['is_payment'] eq 1"/>value="{$data.payinfo.ali_user}"</if>>
</td>
</tr>
<if condition="$data['is_payment'] eq 2">
<tr>
<td class="l">开户支行:</td>
<td class="r">
<input type="text" class="txt" name="password" <if condition="$data['is_payment'] eq 2">value="{$data.payinfo.opening_bank}"<elseif condition="$data['is_payment'] eq 1"/>value=""</if> disabled="disabled">
</td>
</tr>
</if>
</tbody>
</table>
</div>
@ -215,9 +216,9 @@
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="l">银行卡号:</td>
<td class="l"><if condition="$data['is_payment'] eq 2">银行卡号:<elseif condition="$data['is_payment'] eq 1"/>支付宝账号:</if></td>
<td class="r">
<input type="text" class="txt" name="" value="{$data.payinfo.bank_account}" disabled="disabled" placeholder="">
<input type="text" class="txt" name="" <if condition="$data['is_payment'] eq 2">value="{$data.payinfo.bank_account}"<elseif condition="$data['is_payment'] eq 1"/>value="{$data.payinfo.ali_account}"</if> disabled="disabled" placeholder="">
</td>
</tr>
</tbody>

@ -208,6 +208,10 @@
<th>分成比例</th>
<th>特殊补点</th>
<th>结算金额</th>
<th>是否支付宝打款</th>
<th>户名</th>
<th>账号</th>
<th>开户行</th>
<th>操作</th>
</tr>
</thead>
@ -219,6 +223,10 @@
<td colspan="2"></td>
<td><span class="sum_withdraw_amount"></span></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tbody>
</table>
<button class="submit_btn ajax-post" id="submit" type="submit" target-form="form-horizontal" style="margin-top: 50px;float: right">
@ -262,113 +270,169 @@
layer.msg("正在提交请勿重复提交...");
return;
}
var is_zero = 0;
layer.load(2);
is_submit = 0;
var time_start = $("#time_start").val();
var time_end = $("#time_end").val();
var send = [];
$('#tablebox').find('.company_id').each(function(ckey, cval) {
submitData();
}
});
var data = {};
var sec_data = {};
var statement_info = [];
function submitData() {
var is_zero = 0;
layer.load(2);
is_submit = 0;
var time_start = $("#time_start").val();
var time_end = $("#time_end").val();
var send = [];
if ($(cval).html() == "合计") {
return;
}
$('#tablebox').find('.company_id').each(function(ckey, cval) {
data['company_id'] = $(cval).attr('data-company_id');
data['company_name'] = $(cval).html();
data['statement_begin_time'] = time_start;
data['statement_end_time'] = time_end;
sec_data['pay_amount'] = $(cval).next().next().next().text();
sec_data['sum_money'] = $(cval).next().next().next().next().next().next().text();
sec_data['relation_game_id'] = $(cval).next().next().next().next().next().next().next().find('a').attr('data-game_id');
sec_data['game_name'] = $(cval).next().next().text();
var ratio = $(cval).next().next().next().next().text();
// ratio = parseFloat(ratio.slice(0, -1)) + parseFloat($(cval).next().next().next().next().next().find('input').val());
sec_data['ratio'] = parseFloat(ratio.slice(0, -1));
sec_data['increment_ratio'] = parseFloat($(cval).next().next().next().next().next().find('input').val());
sec_data['statement_begin_time'] = $(cval).next().find('.begin_time').text();
sec_data['statement_end_time'] = $(cval).next().find('.end_time').text();
statement_info.push(sec_data);
var data = {};
var sec_data = {};
var statement_info = [];
if ($(cval).html() == "合计") {
return;
}
data['company_id'] = $(cval).attr('data-company_id');
data['company_name'] = $(cval).html();
data['is_payment'] = $(cval).parent().find(".is_payment").val();
data['payee_name'] = $(cval).parent().find(".payee_name").val();
data['bank_account'] = $(cval).parent().find(".bank_account").val();
data['opening_bank'] = $(cval).parent().find(".opening_bank").val();
data['ali_account'] = $(cval).parent().find(".ali_account").val();
data['ali_user'] = $(cval).parent().find(".ali_user").val();
data['statement_begin_time'] = time_start;
data['statement_end_time'] = time_end;
sec_data['pay_amount'] = $(cval).next().next().next().text();
sec_data['sum_money'] = $(cval).next().next().next().next().next().next().text();
sec_data['relation_game_id'] = $(cval).parent().find('.delete').attr('data-game_id');
sec_data['game_name'] = $(cval).next().next().text();
var ratio = $(cval).next().next().next().next().text();
// ratio = parseFloat(ratio.slice(0, -1)) + parseFloat($(cval).next().next().next().next().next().find('input').val());
sec_data['ratio'] = parseFloat(ratio.slice(0, -1));
sec_data['increment_ratio'] = parseFloat($(cval).next().next().next().next().next().find('input').val());
sec_data['statement_begin_time'] = $(cval).next().find('.begin_time').text();
sec_data['statement_end_time'] = $(cval).next().find('.end_time').text();
statement_info.push(sec_data);
if (sec_data['increment_ratio']<=0||sec_data['pay_amount']<=0) {
is_zero = 1;
layer.closeAll("loading");
return;
}
var _append = $(cval).parent();
var row = $(cval).attr('rowspan');
for (var i=0;i<row-1;i++) {
sec_data = {};
_append = _append.next();
sec_data['statement_begin_time'] = _append.find('.relation_game_name').prev().find('.begin_time').text();
sec_data['statement_end_time'] = _append.find('.relation_game_name').prev().find('.end_time').text();
sec_data['game_name'] = _append.find('.relation_game_name').text();
sec_data['pay_amount'] = _append.find('.relation_game_name').next().text();
sec_data['sum_money'] = _append.find('.relation_game_name').next().next().next().next().text();
sec_data['relation_game_id'] = _append.find('.relation_game_name').next().next().next().next().next().find('a').attr('data-game_id');
var ratio = _append.find('.relation_game_name').next().next().text();
// ratio = parseFloat(ratio.slice(0, -1)) + parseFloat(_append.find('.relation_game_name').next().next().next().find('input').val());
sec_data['ratio'] = ratio.slice(0, -1);
sec_data['increment_ratio'] = parseFloat(_append.find('.relation_game_name').next().next().next().find('input').val());
if (sec_data['increment_ratio']<=0||sec_data['pay_amount']<=0) {
is_zero = 1;
layer.closeAll("loading");
return;
}
var _append = $(cval).parent();
var row = $(cval).attr('rowspan');
for (var i=0;i<row-1;i++) {
sec_data = {};
_append = _append.next();
sec_data['statement_begin_time'] = _append.find('.relation_game_name').prev().find('.begin_time').text();
sec_data['statement_end_time'] = _append.find('.relation_game_name').prev().find('.end_time').text();
sec_data['game_name'] = _append.find('.relation_game_name').text();
sec_data['pay_amount'] = _append.find('.relation_game_name').next().text();
sec_data['sum_money'] = _append.find('.relation_game_name').next().next().next().next().text();
sec_data['relation_game_id'] = _append.find('.relation_game_name').next().next().next().next().next().find('a').attr('data-game_id');
var ratio = _append.find('.relation_game_name').next().next().text();
// ratio = parseFloat(ratio.slice(0, -1)) + parseFloat(_append.find('.relation_game_name').next().next().next().find('input').val());
sec_data['ratio'] = ratio.slice(0, -1);
sec_data['increment_ratio'] = parseFloat(_append.find('.relation_game_name').next().next().next().find('input').val());
if (sec_data['increment_ratio']<=0||sec_data['pay_amount']<=0) {
is_zero = 1;
layer.closeAll("loading");
return;
}
statement_info.push(sec_data);
}
data['statement_info'] = statement_info;
send.push(data);
});
statement_info.push(sec_data);
if (is_zero == 1) {
is_submit = 1;
layer.msg("不能提交补点比例为零或者流水为零的数据");
return;
}
if (send.length != 0) {
$.ajax({
url: '{:U("addSpecialComplementPost")}',
type: 'post',
dataType: 'json',
data: {data:JSON.stringify(send)},
success: function(result) {
if (result.status == 1) {
is_submit = 1;
layer.msg("插入成功");
parent.location.reload();
data['statement_info'] = statement_info;
send.push(data);
});
} else if (result.status==1001) {
is_submit = 1;
layer.msg("数据插入失败");
if (is_zero == 1) {
is_submit = 1;
layer.msg("不能提交补点比例为零或者流水为零的数据");
return;
}
} else {
if (send.length != 0) {
$.ajax({
url: '{:U("checkComplementHistory")}',
type: 'post',
dataType: 'json',
data: {data:JSON.stringify(send)},
success: function(result) {
if (result.status == 1) {
layer.confirm(result.data+"在此结算时间有特殊补点记录,是否继续添加?", {
btn: ['是','否'] //按钮
}, function(){
layer.load(2);
$.ajax({
url: '{:U("addSpecialComplementPost")}',
type: 'post',
dataType: 'json',
data: {data:JSON.stringify(send)},
success: function(result) {
if (result.status == 1) {
is_submit = 1;
layer.msg("插入成功");
parent.location.reload();
} else if (result.status==1001) {
is_submit = 1;
layer.msg("数据插入失败");
} else {
is_submit = 1;
layer.msg(result.msg);
}
layer.closeAll("loading");
}});
}, function(){
is_submit = 1;
layer.msg(result.msg);
}
layer.closeAll("loading");
}});
} else {
is_submit = 1;
layer.closeAll("loading");
layer.msg('数据为空不能提交');
}
return;
});
} else {
$.ajax({
url: '{:U("addSpecialComplementPost")}',
type: 'post',
dataType: 'json',
data: {data:JSON.stringify(send)},
success: function(result) {
if (result.status == 1) {
is_submit = 1;
layer.msg("插入成功");
parent.location.reload();
} else if (result.status==1001) {
is_submit = 1;
layer.msg("数据插入失败");
} else {
is_submit = 1;
layer.msg(result.msg);
}
layer.closeAll("loading");
}});
}
layer.closeAll("loading");
}});
} else {
is_submit = 1;
layer.closeAll("loading");
layer.msg('数据为空不能提交');
}
});
}
var is_add = 1;
//添加公司比例操作
$('#add_company').click(function (e) {
@ -468,7 +532,6 @@
get_time = get_time.next();
}
for (var time in begin_time) {
if ((begin_time[time]>=time_start && begin_time[time]<=time_end) || (end_time[time]>=time_start && end_time[time]<=time_end)||(begin_time[time]<=time_start && end_time[time] >= time_end)) {
@ -480,8 +543,12 @@
}
}
$(cval).attr('rowspan',parseInt(row)+parseInt(data[item]['row']));
var row_add = parseInt(row)+parseInt(data[item]['row']);
$(cval).attr('rowspan',row_add);
$(cval).parent().find(".is_payment_s").attr('rowspan',row_add);
$(cval).parent().find(".payee_name_s").attr('rowspan',row_add);
$(cval).parent().find(".bank_account_s").attr('rowspan',row_add);
$(cval).parent().find(".opening_bank_s").attr('rowspan',row_add);
for(var item_sec in data[item]['begin_time']) {
html += "<tr>" +
@ -520,6 +587,24 @@
"<td>"+data[item]['ratio'][0]+"%</td>" +
"<td><input oninput='if($(this).val()>100){$(this).val(100);}' value='0' type='number' style='width: 50px;text-align: center' class='complement'/>%</td>" +
"<td class='withdraw_amount'>"+data[item]['withdraw_amount'][0]+"</td>" +
"<td rowspan='"+data[item]['row']+"' class='is_payment_s'>" +
"<select class='is_payment'>" +
"<option value='1'"+(data[item]['is_payment']==1?'selected':'')+"></option>" +
"<option value='2'"+(data[item]['is_payment']!=1?'selected':'')+"></option>" +
"</select>" +
"</td>" +
"<td rowspan='"+data[item]['row']+"' class='payee_name_s'>" +
"<input class='payee_name' placeholder='请输入户名' "+(data[item]['is_payment']==1?'style=\\\'display:none\\\'':'')+" value='"+data[item]['payee_name']+"'>" +
"<input class='ali_user' placeholder='支付宝真实姓名' "+(data[item]['is_payment']!=1?'style=\\\'display:none\\\'':'')+" value='"+data[item]['ali_user']+"'>" +
"</td>" +
"<td rowspan='"+data[item]['row']+"' class='bank_account_s'>" +
"<input class='bank_account' placeholder='请输入账号' "+(data[item]['is_payment']==1?'style=\\\'display:none\\\'':'')+" value='"+data[item]['bank_account']+"'>" +
"<input class='ali_account' placeholder='请输入支付宝账号' " +(data[item]['is_payment']!=1?'style=\\\'display:none\\\'':'')+" value='"+data[item]['ali_account']+"'>" +
"</td>" +
"<td rowspan='"+data[item]['row']+"' class='opening_bank_s'>" +
"<input class='opening_bank' placeholder='请输入开户行' "+(data[item]['is_payment']==1?'style=\\\'display:none\\\'':'')+" value='"+data[item]['opening_bank']+"'>" +
"<input class='ali_opening_bank' placeholder='请输入开户行' "+(data[item]['is_payment']!=1?'style=\\\'display:none\\\'':'')+" value='' disabled>" +
"</td>" +
"<td><a data-value='"+data[item]['company_name']+"' data-game_id='"+data[item]['relation_game_id'][0]+"' class='delete'>删除</a></td></tr>";
for(var item_sec in data[item]['begin_time']) {
if (item_sec != 0) {
@ -538,6 +623,8 @@
complementChange();
DeleteTd();
caculateAmount();
isPaymentChange();
checkInput();
}
@ -550,6 +637,58 @@
})
});
function checkInput() {
$(".ali_user").off("blur");
$(".ali_account").off("blur");
$(".ali_user").bind("blur", function(){
var name = $(this).val();
if(!(\/^[\\u4e00-\\u9fa5]+$\/i.test(name))&&name.length>0){
$(this).val("");
layer.msg('支付宝真实姓名错误');
}
if (name.length>10) {
$(this).val(name.substr(0,10));
layer.msg('字符输入超过十位');
return;
}
});
$(".ali_account").bind("blur", function(){
var strEmail = $(this).val();
var flagPhone=\/^(\\d{11})$\/;
var flagEmail = \/^\\w+((-\\w+)|(\\.\\w+))*\\@[A-Za-z0-9]+((\\.|-)[A-Za-z0-9]+)*\\.[A-Za-z0-9]+$\/;
if(flagPhone.test(strEmail)==false && flagEmail.test(strEmail) == false && strEmail.length>0) {
$(this).val("");
layer.msg('支付宝账号格式不正确');
}
});
}
function isPaymentChange() {
$(".is_payment").off("change");
$(".is_payment").change(function() {
var is_payment = $(this).val();
var grandparent = $(this).parent().parent();
grandparent.find(".payee_name").toggle();
grandparent.find(".bank_account").toggle();
grandparent.find(".opening_bank").toggle();
grandparent.find(".ali_user").toggle();
grandparent.find(".ali_account").toggle();
grandparent.find(".ali_opening_bank").toggle();
});
}
function caculateAmount() {
var pay_amount = 0;
@ -613,22 +752,54 @@
var is_first = $(this).parent().parent().children(":first").text();
var first_row = $(this).parent().parent().children(":first").attr('rowspan');
var company_id = $(this).parent().parent().children(":first").attr('data-company_id');
var is_payment = $(this).parent().parent().find(".is_payment").val();
var payee_name = $(this).parent().parent().find(".payee_name").val();
var bank_account = $(this).parent().parent().find(".bank_account").val();
var opening_bank = $(this).parent().parent().find(".opening_bank").val();
var ali_user = $(this).parent().parent().find(".ali_user").val();
var ali_account = $(this).parent().parent().find(".ali_account").val();
//判断公司是否隶属于该公司
if (is_first == company_name['value']) {
var html = "<td class='company_id' rowspan='"+(first_row-1)+"' data-company_id='"+company_id+"'>"+is_first+"</td>";
var payinfo = "<td class='is_payment_s' rowspan='"+(first_row-1)+"'>" +
"<select class='is_payment'>" +
"<option value='1' "+(is_payment==1?'selected':'')+"></option>" +
"<option value='2' "+(is_payment!=1?'selected':'')+"></option>" +
"</select>" +
"</td>" +"<td rowspan='"+(first_row-1)+"' class='payee_name_s'>" +
"<input class='payee_name' placeholder='请输入户名' "+(is_payment==1?'style=\\\'display:none\\\'':'')+" value='"+payee_name+"'>" +
"<input class='ali_user' placeholder='请输入户名' oninput='value.replace(\'\\d{11}\','$1')' "+(is_payment!=1?'style=\\\'display:none\\\'':'')+" value='"+ali_user+"'>" +
"</td>" +
"<td rowspan='"+(first_row-1)+"' class='bank_account_s'>" +
"<input class='bank_account' placeholder='请输入账号' "+(is_payment==1?'style=\\\'display:none\\\'':'')+" value='"+bank_account+"'>" +
"<input class='ali_account' placeholder='请输入账号' oninput='value.replace(\'\\d{11}\','$1')' "+(is_payment!=1?'style=\\\'display:none\\\'':'')+" value='"+ali_account+"'>" +
"</td>" +
"<td rowspan='"+(first_row-1)+"' class='opening_bank_s'>" +
"<input class='opening_bank' placeholder='请输入开户行' "+(is_payment==1?'style=\\\'display:none\\\'':'')+" value='"+opening_bank+"'>" +
"<input class='ali_opening_bank' placeholder='请输入开户行' "+(is_payment!=1?'style=\\\'display:none\\\'':'')+" value=''>" +
"</td>";
var next_company = $(this).parent().parent().next().find(".company_id").text();
//判断接下来还有没有该公司的比例,如有增添加公司名称行
if (!next_company&&next_company!="合计") {
$(this).parent().parent().next().prepend(html);
$(this).parent().parent().next().find(".delete").parent().before(payinfo);
isPaymentChange();
checkInput();
}
} else {
$('#tablebox').find('.company_id').each(function(ckey, cval) {
if($(cval).html() == company_name['value']){
var rowspan = $(cval).attr('rowspan');
$(cval).parent().find(".is_payment_s").attr('rowspan',rowspan-1);
$(cval).parent().find(".payee_name_s").attr('rowspan',rowspan-1);
$(cval).parent().find(".bank_account_s").attr('rowspan',rowspan-1);
$(cval).parent().find(".opening_bank_s").attr('rowspan',rowspan-1);
$(cval).attr('rowspan',rowspan-1);
}

@ -127,8 +127,8 @@
<th>帐号</th>
<th>开户行</th>
<th>是否支付宝打款</th>
<th>是否结算</th>
<th>备注</th>
<if condition="!$is_special_export"><th>是否结算</th></if>
<if condition="!$is_special_export"><th>备注</th></if>
<if condition="!$is_export">
<th>操作</th>
@ -206,8 +206,8 @@
<td rowspan="{$com.row}"></td>
</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>
<if condition="!$is_special_export"><td rowspan="{$com.row}"><if condition="$com['st'] eq 0"><else /></if></td></if>
<if condition="!$is_special_export"><td rowspan="{$com.row}">{$com.remark}</td></if>
<if condition="!$is_export">
<td rowspan="{$com.row}">

@ -2,6 +2,8 @@
namespace Base\Factory;
use Base\Factory\LeavePercentageFactory;
use Base\Factory\SpecialCompoentFactory;
use Base\Factory\SpecialCompoentCaculateFactory;
class BaseFactory {
@ -10,6 +12,8 @@ class BaseFactory {
public $classes = [
'LeavePercentageFactory' => LeavePercentageFactory::class,
'SpecialCompoentFactory' => SpecialCompoentFactory::class,
'SpecialCompoentCaculateFactory' => SpecialCompoentCaculateFactory::class,
];
public function __construct()

@ -0,0 +1,164 @@
<?php
namespace Base\Factory;
class SpecialCompoentCaculateFactory {
public function __construct(){}
/**
* 订单相关金额重算
* @param array $statement_info
* @param int $company_type
* @param int $company_id
* @return array|bool
*/
public function caculateStatementInfo($statement_info = [],$company_type = 2,$company_id = 0) {
if (!$statement_info) {
return false;
}
if (!$company_id) {
return false;
}
$platform_amount = 0;
$statement_amount = 0;
$promote_id = M("promote","tab_")
->field("id")
->where(['company_id'=>$company_id])
->select();
if ($promote_id) {
$map['promote_id'] = ['in',array_column($promote_id,'id')];
} else {
$map['promote_id'] = '-1';
}
$map['tab_spend.pay_status'] = 1;
if ($company_type == 2) {
foreach($statement_info as $key => $value) {
$game_list = $value["game_list"];
foreach ($game_list as $gk => $gv) {
$start_time = str_replace('.','-',$gv['statement_begin_time']);
$end_time = str_replace('.','-',$gv['statement_end_time']);
$map['relation_game_id'] = $gv['relation_game_id'];
$map['payed_time'] = ['between', [strtotime($start_time), strtotime($end_time)+86399]];
$amount = M("spend","tab_")
->field("sum(pay_amount) pay_amount")
->join("left join tab_game game on tab_spend.game_id=game.id")
->where($map)
->find()['pay_amount'];
$statement_info[$key]['game_list'][$gk]['pay_amount'] = floatval($amount);
$statement_info[$key]['game_list'][$gk]['sum_money'] = (string)(number_format($amount*($gv['increment_ratio']/100),2,'.',''));
$platform_amount += $amount;
$statement_amount += floatval($amount*($gv['increment_ratio']/100));
}
}
} else {
foreach($statement_info as $key => $value) {
$start_time = str_replace('.','-',$value['statement_begin_time']);
$end_time = str_replace('.','-',$value['statement_end_time']);
$map['relation_game_id'] = $value['relation_game_id'];
$map['payed_time'] = ['between', [strtotime($start_time), strtotime($end_time)+86399]];
$amount = M("spend","tab_")
->field("sum(pay_amount) pay_amount")
->join("left join tab_game game on tab_spend.game_id=game.id")
->where($map)
->find()['pay_amount'];
$statement_info[$key]['pay_amount'] = floatval($amount);
$statement_info[$key]['sum_money'] = (string)(number_format($amount*($value['increment_ratio']/100),2,'.',''));
$platform_amount += $amount;
$statement_amount += floatval($amount*($value['increment_ratio']/100));
}
}
return [$statement_info,$platform_amount,$statement_amount];
}
/**
* 公司信息更新
* @param int $company_id
* @param string $nickname
* @return array
*/
public function updateCompanyInfo($company_id = 0,$nickname = '') {
$company_data = M("promote_company","tab_")->where(['id'=>$company_id])->find();
$company_type = M("company_relation","tab_")
->where("(first_company_id={$company_id} and first_company_type =2) or (second_company_id={$company_id} and second_company_type=2)")
->find();
$proCompany_info['id'] = $company_data['id'];
$proCompany_info['partner'] =$company_data['company_name'];
$proCompany_info['link_man'] = $company_data['settlement_contact'];
$proCompany_info['link_phone'] =$company_data['contact_phone'];
$proCompany_info['address'] = $company_data['address'];
$proCompany_info['payee_name'] =$company_data['bank_address'];
$proCompany_info['bank_account'] = $company_data['bank_card'];
$proCompany_info['opening_bank'] =$company_data['bank_name'];
$proCompany_info['fax_ratio'] = $company_data['fax_ratio'];
$proCompany_info['taxation_rate'] = $company_data['taxation_rate'];
$proCompany_info['company_belong'] = $company_data['company_belong'];
$proCompany_info['company_type'] = $company_data['company_type'];
$proCompany_info['develop_type'] = $company_data['develop_type'];
$proCompany_info['ali_user'] = $company_data['ali_user'];
$proCompany_info['ali_account'] =$company_data['ali_account'];
$proCompany_info['has_server_fee'] = $company_data['has_server_fee'];
$proCompany_info['server_fee'] =$company_data['server_fee'];
$proCompany_info['has_ratio'] = $company_data['has_ratio'];
$proCompany_info['turnover_ratio'] =$company_data['turnover_ratio'];
$proCompany_info['invoice_type'] = $company_type['invoice_type'];
$proCompany_info['invoice_content'] = $company_type['invoice_content'];
$nickname?($proCompany_info['nickname'] = $nickname):'';
if ($company_type['first_company_id'] == $company_id) {
$weCompany = M("company_info","tab_")->where(['id'=>$company_type['second_company_id']])->find();
} elseif ($company_type['second_company_id'] == $company_id) {
$weCompany = M("company_info","tab_")->where(['id'=>$company_type['first_company_id']])->find();
}
$secord_info['id'] = $weCompany['id'];
$secord_info['partner'] =$weCompany['partner'];
$secord_info['link_man'] = $weCompany['link_man'];
$secord_info['link_phone'] =$weCompany['link_phone'];
$secord_info['address'] = $weCompany['address'];
$secord_info['company_tax_no'] = $weCompany['company_tax_no'];
$secord_info['payee_name'] =$weCompany['payee_name'];
$secord_info['bank_account'] = $weCompany['bank_account'];
$secord_info['opening_bank'] =$weCompany['opening_bank'];
$secord_info['invoice_type'] = $company_type['invoice_type'];
$secord_info['invoice_content'] = $company_type['invoice_content'];
if ($company_type['first_company_id'] == $company_id) {
$first_party_info = $proCompany_info;
$second_party_info = $secord_info;
} elseif ($company_type['second_company_id'] == $company_id) {
$second_party_info = $proCompany_info;
$first_party_info = $secord_info;
}
return [$first_party_info,$second_party_info];
}
}

@ -0,0 +1,86 @@
<?php
namespace Base\Factory;
class SpecialCompoentFactory {
static $DBModel = "";
private $user = '';
public function __construct()
{
self::$DBModel = SM("CompanyStatement","tab_");
$this->user = $_SESSION['onethink_admin']['user_auth']['username'];
}
/**
* 重算特殊补点主方法
*/
public function updateSpecialStatement($id = 0,$withdraw_type = 0) {
if (!$id || !$withdraw_type) {
return false;
}
$dbres = self::$DBModel->field("id,verify_status,verify_log,withdraw_type,company_type,company_id,statement_info")->where(['id'=>$id])->find();
if ($dbres['withdraw_type']!=3) {
return false;
}
$statement_info = json_decode($dbres['statement_info'],true);
list($statement_info,$platform_amount,$statement_amount,$first_party_info,$second_party_info) =
$this->caculateFunction($statement_info,$dbres['company_type'],$dbres['company_id'],$statement_info[0]['nickname']?$statement_info[0]['nickname']:'');
$verify = ["create_user"=>$this->user,"create_time"=>date("Y-m-d H:i:s")];
self::$DBModel
->where(['id'=>$id])
->save([
'statement_info'=>json_encode($statement_info),
'first_party_info'=>json_encode($first_party_info),
'second_party_info'=>json_encode($second_party_info),
'pay_amount'=>$platform_amount,
'platform_amount'=>$platform_amount,
'statement_money'=>$statement_amount,
'verify_log'=>json_encode($verify),
'verify_status'=>0,
]);
return true;
}
/**
* 重新计算数据
* @param array $statement_info
* @param int $company_type
* @param int $company_id
* @param string $nickname
* @return array|bool
*/
private function caculateFunction($statement_info = [],$company_type=0,$company_id = 0,$nickname = '') {
if (!$statement_info||!$company_id) {
return false;
}
//工厂模式调用特殊补点重算详细方法
$baseClass = BaseFactory::getInstance();
$caculateClass = $baseClass->factoryClass("SpecialCompoentCaculate");
//订单详细信息重算
list($statement_info,$platform_amount,$statement_amount) = $caculateClass->caculateStatementInfo($statement_info,$company_type,$company_id);
//公司信息重新录入
list($first_party_info,$second_party_info) = $caculateClass->updateCompanyInfo($company_id,$nickname);
return [$statement_info,$platform_amount,$statement_amount,$first_party_info,$second_party_info];
}
}
Loading…
Cancel
Save