12月功能提交

master
zhengyongxing 4 years ago
parent 7e41ad1e18
commit b8af3ea384

@ -1769,7 +1769,7 @@ class CompanyStatementPoolController extends ThinkController
public function splitForPayStatementInfo() {
$ids = $_REQUEST['ids'];
$limit_amount = 20000;
$limit_amount = 10000;
$dbres = $this->DBModel->field("id")->where("id in ({$ids})")->select();
foreach($dbres as $key=>$value){
@ -1780,44 +1780,79 @@ class CompanyStatementPoolController extends ThinkController
if ($value['company_type'] == 2){
//循环info汇总详单
foreach ($statement_data_info as $skey => $svalue) {
if ($svalue['verify_status'] == 1) {
$statement_info = json_decode($svalue['statement_info'],true);
$handle_data = [];
$statement_info = json_decode($svalue['statement_info'], true);
$handle_data = [];
foreach ($statement_info as $k => $v) {
foreach ($statement_info as $k => $v) {
$game_list = $v['game_list'];
$game_list = $v['game_list'];
foreach ($game_list as $gk => $gv ) {
//同一结算时间的汇总成一个数组
if (!$handle_data[$gv['statement_begin_time'].'-'.$gv['statement_end_time']][$v['account']]) {
$handle_data[$gv['statement_begin_time'].'-'.$gv['statement_end_time']][$v['account']] = ['account'=>$v['account'],'game_list'=>[$gv]];
} else {
$handle_data[$gv['statement_begin_time'].'-'.$gv['statement_end_time']][$v['account']]['game_list'][] = $gv;
foreach ($game_list as $gk => $gv) {
//同一结算时间的汇总成一个数组
if (!$handle_data[$gv['statement_begin_time'] . '-' . $gv['statement_end_time']][$v['account']]) {
$handle_data[$gv['statement_begin_time'] . '-' . $gv['statement_end_time']][$v['account']] = ['account' => $v['account'], 'game_list' => [$gv]];
} else {
$handle_data[$gv['statement_begin_time'] . '-' . $gv['statement_end_time']][$v['account']]['game_list'][] = $gv;
}
}
}
}
$save = [];
$handle_statement = [];
//将同一时间的汇总详单记录起来
foreach ($handle_data as $hk => $hv) {
$statement_time = explode('-',$hk);
$save['statement_begin_time'] = strtotime(str_replace('.','-',$statement_time[0]));
$save['statement_end_time'] = strtotime(str_replace('.','-',$statement_time[1]));
$handle_statement = json_encode(array_values($hv));
$statement_money = 0;
foreach ($hv as $shk => $shv) {
$game_list = $shv['game_list'];
foreach($game_list as $gk => $gv ) {
$statement_money += $gv['sum_money'];
$save = [];
$handle_statement = [];
//将同一时间的汇总详单记录起来
foreach ($handle_data as $hk => $hv) {
$statement_time = explode('-', $hk);
$save['statement_begin_time'] = strtotime(str_replace('.', '-', $statement_time[0]));
$save['statement_end_time'] = strtotime(str_replace('.', '-', $statement_time[1]));
$handle_statement = json_encode(array_values($hv));
$statement_money = 0;
foreach ($hv as $shk => $shv) {
$game_list = $shv['game_list'];
foreach ($game_list as $gk => $gv) {
$statement_money += $gv['sum_money'];
}
}
}
if ($statement_money > $limit_amount) {
for($amount=$statement_money;$amount>0;$amount -= $limit_amount) {
if ($statement_money > $limit_amount) {
for ($amount = $statement_money; $amount > 0; $amount -= $limit_amount) {
$save['statement_info'] = $handle_statement;
$save['company_id'] = $svalue['company_id'];
$save['company_name'] = $svalue['company_name'];
$save['company_type'] = $svalue['company_type'];
$save['pay_type'] = $svalue['pay_type'];
$save['verify_status'] = $svalue['verify_status'];
$save['remark'] = $svalue['remark'];
$save['company_info'] = $svalue['company_info'];
$save['statement_num'] = "JS_" . date("YmdHis", time()) . sp_random_string(5);
if ($amount > $limit_amount) {
$save['statement_money'] = $limit_amount;
} else {
$save['statement_money'] = $amount;
}
// $setStatementInfo = json_decode($svalue['statement_info'],true);
// foreach ($setStatementInfo as $sskey => $ssvalue) {
//
// $setStatementInfo[$sskey]['pay_amount'] = $save['statement_money']/(($ssvalue['ratio']-$ssvalue['fax_ratio'])/100);
// $setStatementInfo[$sskey]['sum_money'] = $save['statement_money'];
//
// }
//
// $save['statement_info'] = json_encode($setStatementInfo);
$save['statement_info_id'] = $svalue['id'];
$save['fine'] = $svalue['fine'];
$save['reward'] = $svalue['reward'];
$save['is_limit'] = 1;
M("pay_statement_info", "tab_")->add($save);
}
} else {
$save['statement_info'] = $handle_statement;
$save['company_id'] = $svalue['company_id'];
$save['company_name'] = $svalue['company_name'];
@ -1826,79 +1861,63 @@ class CompanyStatementPoolController extends ThinkController
$save['verify_status'] = $svalue['verify_status'];
$save['remark'] = $svalue['remark'];
$save['company_info'] = $svalue['company_info'];
$save['statement_num'] = "JS_".date("YmdHis",time()).sp_random_string(5);
if ($amount > $limit_amount) {
$save['statement_money'] = $limit_amount;
} else {
$save['statement_money'] = $amount;
}
$save['statement_num'] = "JS_" . date("YmdHis", time()) . $save['company_id'] . sp_random_string(5);
$save['statement_money'] = $statement_money;
$save['statement_info_id'] = $svalue['id'];
$save['fine'] = $svalue['fine'];
$save['reward'] = $svalue['reward'];
$save['is_limit'] = 1;
M("pay_statement_info","tab_")->add($save);
M("pay_statement_info", "tab_")->add($save);
}
} else {
$save['statement_info'] = $handle_statement;
$save['company_id'] = $svalue['company_id'];
$save['company_name'] = $svalue['company_name'];
$save['company_type'] = $svalue['company_type'];
$save['pay_type'] = $svalue['pay_type'];
$save['verify_status'] = $svalue['verify_status'];
$save['remark'] = $svalue['remark'];
$save['company_info'] = $svalue['company_info'];
$save['statement_num'] = "JS_".date("YmdHis",time()).sp_random_string(5);
$save['statement_money'] = $statement_money;
$save['statement_info_id'] = $svalue['id'];
$save['fine'] = $svalue['fine'];
$save['reward'] = $svalue['reward'];
M("pay_statement_info","tab_")->add($save);
}
}
}
}
else {
foreach ($statement_data_info as $skey => $svalue) {
if ($svalue['verify_status'] == 1) {
$statement_money = $svalue['statement_money'];
if ($statement_money > $limit_amount) {
for ($amount = $statement_money; $amount > 0; $amount -= $limit_amount) {
$save['statement_begin_time'] = $svalue['statement_begin_time'];
$save['statement_end_time'] = $svalue['statement_end_time'];
$statement_money = $svalue['statement_money'];
if ($statement_money > $limit_amount) {
for ($amount = $statement_money; $amount > 0; $amount -= $limit_amount) {
$save['statement_begin_time'] = $svalue['statement_begin_time'];
$save['statement_end_time'] = $svalue['statement_end_time'];
$save['statement_info'] = $svalue['statement_info'];
$save['company_id'] = $svalue['company_id'];
$save['company_name'] = $svalue['company_name'];
$save['company_type'] = $svalue['company_type'];
$save['pay_type'] = $svalue['pay_type'];
$save['verify_status'] = $svalue['verify_status'];
$save['remark'] = $svalue['remark'];
$save['company_info'] = $svalue['company_info'];
$save['statement_num'] = "JS_" . date("YmdHis", time()) . sp_random_string(5);
$save['statement_money'] = $svalue['statement_money'];
$save['company_id'] = $svalue['company_id'];
$save['company_name'] = $svalue['company_name'];
$save['company_type'] = $svalue['company_type'];
$save['pay_type'] = $svalue['pay_type'];
$save['verify_status'] = $svalue['verify_status'];
$save['remark'] = $svalue['remark'];
$save['company_info'] = $svalue['company_info'];
$save['statement_num'] = "JS_" . date("YmdHis", time()) . $svalue['company_id'] . sp_random_string(5);
$save['statement_money'] = $svalue['statement_money'];
$save['is_limit'] = 1;
if ($amount > $limit_amount) {
$save['statement_money'] = $limit_amount;
} else {
$save['statement_money'] = $amount;
}
if ($amount > $limit_amount) {
$save['statement_money'] = $limit_amount;
} else {
$save['statement_money'] = $amount;
}
$setStatementInfo = json_decode($svalue['statement_info'],true);
foreach ($setStatementInfo as $sskey => $ssvalue) {
$save['statement_info_id'] = $svalue['id'];
$save['fine'] = $svalue['fine'];
$save['reward'] = $svalue['reward'];
$setStatementInfo[$sskey]['pay_amount'] = $save['statement_money']/(($ssvalue['ratio']-$ssvalue['fax_ratio'])/100);
$setStatementInfo[$sskey]['sum_money'] = $save['statement_money'];
M("pay_statement_info", "tab_")->add($save);
}
} else {
for ($amount = $statement_money; $statement_money > 0; $amount -= $limit_amount) {
}
$save['statement_info'] = json_encode($setStatementInfo);
$save['statement_info_id'] = $svalue['id'];
$save['fine'] = $svalue['fine'];
$save['reward'] = $svalue['reward'];
M("pay_statement_info", "tab_")->add($save);
}
} else {
$save['statement_begin_time'] = $svalue['statement_begin_time'];
$save['statement_end_time'] = $svalue['statement_end_time'];
$save['statement_info'] = $svalue['statement_info'];

@ -157,7 +157,6 @@ class ExcelPaymentController extends BaseController
if(count($checkarr) < 1){
$this->ajaxReturn(["status"=>1,"msg"=>"ok"]);
}
$limit_amount = 20000;
// dump($batch);die();
$ExcelStatementInfo = M('ExcelStatementInfo',"tab_");
@ -191,34 +190,12 @@ class ExcelPaymentController extends BaseController
$this->ajaxReturn(["status"=>0,"msg"=>"支付宝真实姓名及登陆账号不允许为空"]);
}
$statement_money = $v['statement_money'];
if ($statement_money > $limit_amount) {
for($amount=$statement_money;$amount>0;$amount -= $limit_amount) {
if ($amount > $limit_amount) {
$v['statement_money'] = $limit_amount;
} else {
$v['statement_money'] = $amount;
}
$res = $ExcelStatementInfo->add($v);
if($res === false){
M('ExcelStatementInfo',"tab_")->where("batch_num = '{$v['batch_num']}'")->delete();
$this->ajaxReturn(["status"=>0,"msg"=>"添加失败"]);
}
}
} else {
$res = $ExcelStatementInfo->add($v);
if($res === false){
M('ExcelStatementInfo',"tab_")->where("batch_num = '{$v['batch_num']}'")->delete();
$this->ajaxReturn(["status"=>0,"msg"=>"添加失败"]);
}
$res = $ExcelStatementInfo->add($v);
if($res === false){
M('ExcelStatementInfo',"tab_")->where("batch_num = '{$v['batch_num']}'")->delete();
$this->ajaxReturn(["status"=>0,"msg"=>"添加失败"]);
}
}
$this->ajaxReturn(["status"=>1,"msg"=>"ok"]);
}

@ -93,17 +93,19 @@ class PaymentController extends BaseController
}
// dump($map);die();
$CompanyInfo = M("company_statement_info","tab_")
->alias('s')
->field("s.*,p.statement_num statement_pool_num")
->join("left join tab_company_statement_pool p ON p.id = s.pool_id")
->where($map)
->page($page,$row)
->order("FIELD(s.pay_status,0,-1,1),s.verify_status desc")
->select();
$handleData = [];
$CompanyInfo = M("pay_statement_info","tab_")
->alias('s')
->field("s.*,p.statement_num statement_pool_num")
->join("left join tab_company_statement_info i ON s.statement_info_id = i.id")
->join("left join tab_company_statement_pool p ON p.id = i.pool_id")
->where($map)
->page($page,$row)
->order("FIELD(s.pay_status,0,-1,1),s.verify_status desc")
->select();
foreach($CompanyInfo as $k=>&$v){
$handleData[] = $v['id'];
$v['can_pay'] = 1;
if($v['verify_status'] == -1){
$v['verify_status_str']="信息配置不全";
@ -137,13 +139,59 @@ class PaymentController extends BaseController
}
$v["valid"] = "{$v['statement_begin_time']} ~ {$v['statement_end_time']}";
}
$statementInfo = M("pay_statement_info","tab_")
->alias('s')
->field("s.*,p.statement_num statement_pool_num")
->join("left join tab_company_statement_info i ON s.statement_info_id = i.id")
->join("left join tab_company_statement_pool p ON p.id = i.pool_id")
->where(['statement_info_id'=>['in',$handleData]])
->order("FIELD(s.pay_status,0,-1,1),s.verify_status desc")
->select();
$handleData = [];
foreach ($statementInfo as $key => $value) {
$value['can_pay'] = 1;
if($value['verify_status'] == -1){
$value['verify_status_str']="信息配置不全";
$value['can_pay'] = 0;
}else{
if($value['pay_status'] == 1){ $value['can_pay'] = 0; }
$value['verify_status_str'] = $this->PayStatus[$value['pay_status']];
if($value['pay_status'] == 1){
$value['pay_type'] = $value['pay_type'] == 1 ? "提现" :"线上打款";
$value['verify_status_str'] .= ("/". $value['pay_type']);
}
}
$value['company_type'] = $this->CompanyType[$value['company_type']];
$value['statement_begin_time'] = date('Y-m-d',$value['statement_begin_time']);
$value['statement_end_time'] = date('Y-m-d',$value['statement_end_time']);
if(empty($value['pay_time'])){
$value['pay_time'] = "--";
}else{
$value['pay_time'] = date('Y-m-d H:i:s',$value['pay_time']);
}
$value["valid"] = "{$value['statement_begin_time']} ~ {$value['statement_end_time']}";
$handleData[$value['statement_info_id']]['data'][] = $value;
$handleData[$value['statement_info_id']]['ids'][] = $value['id'];
}
foreach ($CompanyInfo as $key=>$value) {
$CompanyInfo[$key]['son_info'] = $handleData[$value['id']]['data'];
$CompanyInfo[$key]['ids'] = implode(',',$handleData[$value['id']]['ids']);
}
// dump($CompanyInfo);die();
//统计待打款金额
$countmap = $map;
$countmap['pay_status']=["neq",1];
$money = M("pay_statement_info","tab_")->alias('s')->field("sum(statement_money) statement_money")->where($countmap)->find();
$money = M("company_statement_info","tab_")->alias('s')->field("sum(statement_money) statement_money")->where($countmap)->find();
$count = M("pay_statement_info","tab_")->alias('s')->field("count(id) count")->where($map)->find();
$count = M("company_statement_info","tab_")->alias('s')->field("count(id) count")->where($map)->find();
$page = set_pagination($count['count'], $row);
if ($page) {
$this->assign('_page', $page);
@ -167,7 +215,7 @@ class PaymentController extends BaseController
$is_export = true;
}
//获取基本信息
$dbres = M("pay_statement_info","tab_")->where("id='{$id}'")->select();
$dbres = M("company_statement_info","tab_")->where("id='{$id}'")->select();
$title = $dbres[0]['company_name'];
$this->assign("title",$title);
@ -182,41 +230,233 @@ class PaymentController extends BaseController
}
}
//改变结构
public function changeDataStruct($statement_info = [],$is_export = 0,&$week_line = 1) {
$game_list = [];
$old_line = $week_line;
//使用时间与会长账号作为键值分离数据
foreach($statement_info as $sk=>$sv){
foreach($sv['game_list'] as $gk=>$gv){
$gv['account'] = $sv['account'];
$game_list[$gv['statement_begin_time'].'-'.$gv['statement_end_time']][$gv['account']][] = $gv;
}
}
$game_data = [];
$handle_data = [];
//处理游戏金额数据
foreach($game_list as $gk => $gv) {
foreach ($gv as $sk => $sv) {
$game_data['account'] = $sk;
$game_data['row'] = count($sv);
if ($game_data['row'] == '0') {
$game_data['row'] = 1;
}
$game_data['time_row'] = count($sv);
if ($game_data['time_row'] == '0') {
$game_data['time_row'] = 1;
}
$game_data['time'] = $gk;
$game_data['week_amount'] = 0;
//周结算金额计算
for ($i=0;;$i++) {
if ($sv[$i]['sum_money']) {
$game_data['week_amount'] += $sv[$i]['sum_money'];
$game_data['withhold_amount'] += $sv[$i]['withhold'];
$game_data['fine'] += $sv[$i]['fine'];
$game_data['reward'] += $sv[$i]['reward'];
} else {
break;
}
}
$game_data['game_list'] = $sv;
array_push($handle_data,$game_data);
$game_data = [];
}
}
$substract = 1;
//添加周结算金额,合并相同的结算时间
foreach($handle_data as $hk => $hv) {
if($hk > 0) {
for (;;) {
if (!$handle_data[$hk-$substract]['time']) {
$substract++;
} else {
break;
}
}
if ($hv['time'] == $handle_data[$hk-$substract]['time']) {
$handle_data[$hk-$substract]['time_row'] += $handle_data[$hk]['time_row'];
$handle_data[$hk-$substract]['week_amount'] += $handle_data[$hk]['week_amount'];
$handle_data[$hk-$substract]['withhold_amount'] += $handle_data[$hk]['withhold_amount'];
unset($handle_data[$hk]['time']);
unset($handle_data[$hk]['time_row']);
unset($handle_data[$hk]['week_amount']);
}
$substract = 1;
}
}
foreach($handle_data as $hk => $hv) {
$substract = 1;
if ($is_export) {
for (;;) {
if (!$handle_data[$hk+$substract]['time']&&$handle_data[$hk+$substract]['account']) {
// if (
// $hv['account'] == 'zj9587' ||
// $hv['account'] == 'ruiyou' || $hv['account'] == 'weicheng') {
// dump($handle_data[$hk]['time']);
// }
$week_line++;
$substract++;
} else {
break;
}
}
if (count($hv['game_list'])>1) {
$week_line += count($hv['game_list'])-1;
}
$handle_data[$hk]['week_amount'] = "=ROUND(SUM(O{$old_line}:O{$week_line})+SUM(P{$old_line}:P{$week_line})-SUM(Q{$old_line}:Q{$week_line})-SUM(R{$old_line}:R{$week_line}),2)";
if (count($hv['game_list'])>1) {
$old_line += count($hv['game_list']);
} else {
$old_line++;
}
if(count($hv['game_list'])>1) {
$week_line = $old_line ;
} else {
$week_line = $old_line;
}
}
}
return $handle_data?$handle_data:[];
}
//个人汇总结算查看
public function viewPuPool(&$infolist,$is_export){
$line = 1;
$count = [];
$week_line = 2;
//获取对接人
foreach($infolist as $k=>&$v){
$v['statement_info'] = json_decode($v['statement_info'],true);
$v['company_info'] = json_decode($v['company_info'],true);
$v['statement_begin_time'] = date('Y-m-d',$v['statement_begin_time']);
$v['statement_end_time'] = date('Y-m-d',$v['statement_end_time']);
$v['statement_begin_time'] = date('Y.m.d',$v['statement_begin_time']);
$v['statement_end_time'] = date('Y.m.d',$v['statement_end_time']);
if( isset($v['verify_status'])){
if( $v['verify_status'] ==2 ){
$v['is_payment'] = 2; //不打款
}else{
$v['is_payment'] = 1;
}
}
$cline = $line+1;
if($is_export){
$v['sum_money_exp'] = "=";
$v['statement_money'] = "=ROUND(";
}
$handle_data = $this->changeDataStruct($v['statement_info'],$is_export,$week_line);
$v['statement_info'] = $handle_data;
$row = 0;
foreach($v['statement_info'] as $ke=>&$va){
$line ++;
if(isset($va['ratio'])){
$va['increment_ratio'] = 0;
}else{
$va['ratio'] = 0;
$va['row'] = count($va['game_list']);
$row += count($va['game_list']);
foreach($va['game_list'] as $key=>&$val){
$line ++;
if($v['withdraw_type'] != 3) {
// if(!$val['ratio']&&!$val['increment_ratio']) {
// if(isset($val['ratio'])){
// $val['increment_ratio'] = 0;
// }else{
// $val['ratio'] = 0;
// }
// }
if (!$val['increment_ratio']) {
$val['increment_ratio'] = 0;
}
if (!$val['ratio']) {
$val['ratio'] = 0;
}
}
if($is_export){
if($v['withdraw_type'] != 3) {
$val['sum_money'] = "=ROUND((K{$line}-L{$line})*(M{$line}+N{$line}),2)";
} else {
$val['sum_money'] = "=ROUND(K{$line}*(N{$line}),2)";
}
$v['statement_money'] .= "S{$line}+";
}else{
$count['platform_amount'] += $val['pay_amount'];
$count['week_money'] += $val['sum_money'];
$count['sum_money'] += $val['sum_money'];
}
}
}
if($is_export){
//J3*(K3+L3)+M3-N3
$va['sum_money'] = "=J{$line}*(K{$line}+L{$line})+M{$line}-N{$line}";
$count['sum_money_exp'] .= "O{$line}+";
$count['platform_amount_exp'] .= "J{$line}+";
}else{
$count['platform_amount'] += $va['pay_amount'];
$count['sum_money'] += $va['sum_money'];
$v['row'] = $row;
if ($v['row'] == '0') {
$v['row'] = 1;
}
if($is_export){
if($v['withdraw_type'] != 3) {
// $v['statement_money'] .="P{$cline}-Q{$cline},2)";
$v['statement_money'] = substr($v['statement_money'],0,strlen($v['statement_money'])-1) . ",2)";
} else {
$v['statement_money'] = substr($v['statement_money'],0,strlen($v['statement_money'])-1).",2)";
}
}
$v['statement_count'] = count($v['statement_info']);
}
if($is_export){
$count["platform_amount"] = "=".trim($count["platform_amount_exp"],"+");
@ -655,12 +895,13 @@ class PaymentController extends BaseController
$id = $_REQUEST['id'];
$remark = $_REQUEST['remark'];
if(empty(C("ALI_PAYMENT"))){
$this->ajaxReturn(["success"=>"配置错误,无法打款","data"=>["status"=>0]]);
}
// if(empty(C("ALI_PAYMENT"))){
// $this->ajaxReturn(["success"=>"配置错误,无法打款","data"=>["status"=>0]]);
// }
// Vendor("Alipay2020/Fund");
// $fund = new \Fund(C("ALI_PAYMENT"));
$dbres = M("company_statement_info", "tab_")->where("id='{$id}'")->find();
$dbres = M("pay_statement_info", "tab_")->where("id='{$id}'")->find();
$company_info = json_decode($dbres['company_info'], true);
if ($dbres['pay_status'] != 1 && $dbres['verify_status'] == 1) {
//执行打款
@ -668,27 +909,50 @@ class PaymentController extends BaseController
$amount = $dbres['statement_money'];
// $payres = $fund->transfer($company_info['ali_account'], $company_info['ali_user'], $dbres['statement_num'], $amount, $title);
// $resultCode = $payres->code;
// $savedata = ["id"=>$dbres['id']];
$savedata = ["id"=>$dbres['id']];
if (!empty($resultCode)&&$resultCode == 10000) {
$savedata["pay_status"]=1;
} else {
$savedata["pay_status"]=-1;
$savedata["pay_status"]=1;
}
// $payres = json_decode(json_encode($payres), true);
// $payres["remark"] = $remark;
//
// $savedata["pay_info"] = json_encode($payres, JSON_UNESCAPED_UNICODE);
// $savedata["pay_type"]=2;
// $savedata["pay_time"]=time();
$payres = json_decode(json_encode($payres), true);
$payres["remark"] = $remark;
$savedata["pay_info"] = json_encode($payres, JSON_UNESCAPED_UNICODE);
$savedata["pay_type"]=2;
$savedata["pay_time"]=time();
}
M("pay_statement_info","tab_")->save($savedata);
if ($savedata["pay_status"] == -1) {
$this->ajaxReturn(["success"=>"打款成功","data"=>["status"=>0]]);
}
// M("company_statement_info","tab_")->save($savedata);
//支付详单bug修改
$this->setPayVerifyStatus(1,$savedata["pay_type"],$id);
$this->ajaxReturn(["success"=>"打款成功","data"=>["status"=>1]]);
}
/**
* 支付详单状态修改
*/
public function setPayVerifyStatus($change_status,$pay_type,$id) {
$pay_info = M("pay_statement_info","tab_")->where(['id'=>$id])->find();
$info = M("pay_statement_info","tab_")->where("statement_info_id = {$pay_info['statement_info_id']} AND pay_status <> 1")->find();
$dbres['pay_status'] = $change_status;
$dbres['pay_type'] = $pay_type;
$dbres['pay_time'] = time();
if (empty($info)) {
M("company_statement_info","tab_")->where(['id'=>$pay_info['statement_info_id']])->save($dbres);
}
}
/**
* 执行最后聚合表统计
* 整合数据,全部成功则支付成功,否则为支付中
@ -717,7 +981,7 @@ class PaymentController extends BaseController
{
if(!isset($_REQUEST['id'])) $this->error("参数错误");
$id = $_REQUEST['id'];
$info = M("company_statement_info","tab_")->field("pay_info")->where("id='{$id}'")->find()['pay_info'];
$info = M("pay_statement_info","tab_")->field("pay_info")->where("id='{$id}'")->find()['pay_info'];
$info = json_decode($info,true);
$senddata = [];
foreach($info as $k => &$v){
@ -758,7 +1022,7 @@ class PaymentController extends BaseController
($status == 1)?($status_str = '已审核通过'):($status_str = '已审核拒绝');
$verify = M("pay_statement_info","tab_")
$verify = M("company_statement_info","tab_")
->where([
'id'=>['in',$id]
])

@ -116,6 +116,16 @@
::-webkit-scrollbar-thumb:active {
cursor: pointer;
}
.triangle{
width:0;
height:0;
border-top:10px solid blue;
border-left:8px solid transparent;
border-right:8px solid transparent;
border-bottom:0;
/*float: left;*/
}
</style>
<div class="cf main-place top_nav_list navtab_list">
@ -241,8 +251,8 @@
<notemtpy name = "data">
<volist name="data" id="data">
<tr>
<td ><input class="ids" type="checkbox" value="{$data['id']}" data-pay="{$data['can_pay']}" name="ids[]" data-paystatus="{$data.pay_status}" data-verifystatus="{$data.pay_verify_status}"></td>
<td>{$data.company_name}</td>
<td ><input class="ids" type="checkbox" value="{$data['ids']}" data-verify_id="{$data['id']}" data-pay="{$data['can_pay']}" name="ids[]" data-paystatus="{$data.pay_status}" data-verifystatus="{$data.pay_verify_status}"></td>
<td style="text-align: left">{$data.company_name}</td>
<td>{$data.company_type}</td>
<td>{$data.valid}</td>
@ -261,11 +271,42 @@
<td>{$data.remark}</td>
<td>
<a class='confirm viewPool' data-id='{$data.id}'>查看</a>
<if condition="$data['pay_status'] neq 0">
<a class='confirm paymentInfo' data-id='{$data.id}'>打款详情</a>
<if condition="$data['pay_status'] neq 0 and count($data['son_info']) elt 1">
<a class='confirm paymentInfo' data-id="{$data['son_info'][0]['id']}">打款详情</a>
</if>
</td>
</tr>
<volist name="data.son_info" id="s_data">
<if condition="count($data['son_info']) gt 1">
<tr>
<!-- <td ><input class="ids" type="checkbox" value="{$data['id']}" data-pay="{$data['can_pay']}" name="ids[]" data-paystatus="{$data.pay_status}" data-verifystatus="{$data.pay_verify_status}"></td>-->
<td></td>
<td style="text-align: left"><span style="margin-left: 15px">|--{$s_data.company_name}</span></td>
<td>{$s_data.company_type}</td>
<td>{$s_data.valid}</td>
<td>{$s_data.statement_pool_num}</td>
<td>{$s_data.statement_money}</td>
<td>{$data.verify|default='--'}</td>
<!-- <td>{$data.platform_amount}</td>-->
<if condition="($data['verify_status'] eq -1) OR ($data['pay_status'] eq -1) ">
<td style="color: red;">{$s_data.verify_status_str}</td>
<else />
<td>{$s_data.verify_status_str}</td>
</if>
<td>{$s_data.pay_time}</td>
<td>{$s_data.remark}</td>
<td>
<!-- <a class='confirm viewPool' data-id='{$data.id}'>查看</a>-->
<if condition="$s_data['pay_status'] neq 0">
<a class='confirm paymentInfo' data-id='{$s_data.id}'>打款详情</a>
</if>
</td>
</tr>
</if>
</volist>
</volist>
<tr><td style="line-height: 42px;">合计</td><td colspan="13" style="line-height: 42px;">待打款金额:&nbsp;{$money.statement_money}</td></tr>
</notemtpy>
@ -406,7 +447,7 @@
return ;
}
return $(elem).val();
return $(elem).data('verify_id');
}).get();

@ -119,51 +119,212 @@
</tr>
</thead>
<tbody id="statementShow">
<!-- <foreach name="data" item="com">-->
<!-- <tr>-->
<!-- <td rowspan="{$com.statement_count}">{$key-0+1}</td>-->
<!-- <td rowspan="{$com.statement_count}">{$com.company_name}</td>-->
<!-- <td rowspan="{$com.statement_count}">{$com.company_info.account}</td>-->
<!-- <td rowspan="{$com.statement_count}">{$com.company_info.company_relation_str}</td>-->
<!-- <td rowspan="{$com.statement_count}">{$com.company_info.nickname}</td>-->
<!-- <td rowspan="{$com.statement_count}">{$com.company_info.company_type_str}</td>-->
<!-- <td>{$com['statement_info'][0]['game_name']}</td>-->
<!-- <td>{$com['statement_info'][0]['game_type_name']}</td>-->
<!-- <td>{$com['statement_info'][0]['statement_begin_time']} ~ {$com['statement_info'][0]['statement_end_time']}</td>-->
<!-- <td>{$com['statement_info'][0]['pay_amount']}</td>-->
<!-- <td>{$com['statement_info'][0]['ratio']|default=0}%</td>-->
<!-- <td>{$com['statement_info'][0]['increment_ratio']|default=0}%</td>-->
<!-- <td>{$com['statement_info'][0]['reward']}</td>-->
<!-- <td>{$com['statement_info'][0]['fine']}</td>-->
<!-- <td>{$com['statement_info'][0]['sum_money']}</td>-->
<!-- <td rowspan="{$com.statement_count}">{$com.company_info.payee_name}</td>-->
<!-- <td rowspan="{$com.statement_count}">{$com.company_info.bank_account}</td>-->
<!-- <td rowspan="{$com.statement_count}">{$com.company_info.opening_bank}</td>-->
<!-- <td rowspan="{$com.statement_count}"></td>-->
<!-- <td rowspan="{$com.statement_count}">{$com.remark}</td>-->
<!-- </tr>-->
<!-- <foreach name="com.statement_info" item="it" key="k">-->
<!-- <if condition="$k neq 0">-->
<!-- <tr>-->
<!-- <td>{$it['game_name']}</td>-->
<!-- <td>{$it['game_type_name']}</td>-->
<!-- <td>{$it['statement_begin_time']} ~ {$it['statement_end_time']}</td>-->
<!-- <td>{$it['pay_amount']}</td>-->
<!-- <td>{$it['ratio']|default=0}%</td>-->
<!-- <td>{$it['increment_ratio']|default=0}%</td>-->
<!-- <td>{$it['reward']}</td>-->
<!-- <td>{$it['fine']}</td>-->
<!-- <td>{$it['sum_money']}</td>-->
<!-- </tr>-->
<!-- </if>-->
<!-- </foreach>-->
<!-- </foreach>-->
<foreach name="data" item="com">
<tr>
<td rowspan="{$com.statement_count}">{$key-0+1}</td>
<td rowspan="{$com.statement_count}">{$com.company_name}</td>
<td rowspan="{$com.statement_count}">{$com.company_info.account}</td>
<td rowspan="{$com.statement_count}">{$com.company_info.company_relation_str}</td>
<td rowspan="{$com.statement_count}">{$com.company_info.nickname}</td>
<td rowspan="{$com.statement_count}">{$com.company_info.company_type_str}</td>
<td>{$com['statement_info'][0]['game_name']}</td>
<td>{$com['statement_info'][0]['game_type_name']}</td>
<td>{$com['statement_info'][0]['statement_begin_time']} ~ {$com['statement_info'][0]['statement_end_time']}</td>
<td>{$com['statement_info'][0]['pay_amount']}</td>
<td>{$com['statement_info'][0]['ratio']|default=0}%</td>
<td>{$com['statement_info'][0]['increment_ratio']|default=0}%</td>
<td>{$com['statement_info'][0]['reward']}</td>
<td>{$com['statement_info'][0]['fine']}</td>
<td>{$com['statement_info'][0]['sum_money']}</td>
<td rowspan="{$com.statement_count}">{$com.company_info.payee_name}</td>
<td rowspan="{$com.statement_count}">{$com.company_info.bank_account}</td>
<td rowspan="{$com.statement_count}">{$com.company_info.opening_bank}</td>
<td rowspan="{$com.statement_count}"></td>
<td rowspan="{$com.statement_count}">{$com.remark}</td>
</tr>
<td rowspan="{$com.row}">{$key-0+1}</td>
<td rowspan="{$com.row}">{$com.company_name}</td>
<notempty name="com['statement_info']">
<td rowspan="{$com['statement_info'][0]['row']}">{$com['statement_info'][0]['account']}</td>
<else />
<td>-</td>
</notempty>
<foreach name="com.statement_info" item="it" key="k">
<if condition="$k neq 0">
<tr>
<td>{$it['game_name']}</td>
<td>{$it['game_type_name']}</td>
<td>{$it['statement_begin_time']} ~ {$it['statement_end_time']}</td>
<td>{$it['pay_amount']}</td>
<td>{$it['ratio']|default=0}%</td>
<td>{$it['increment_ratio']|default=0}%</td>
<td>{$it['reward']}</td>
<td>{$it['fine']}</td>
<td>{$it['sum_money']}</td>
</tr>
<td rowspan="{$com.row}">{$com.company_info.company_relation_str}</td>
<td rowspan="{$com.row}">{$com.company_info.nickname}</td>
<td rowspan="{$com.row}">{$com.company_info.company_type_str}</td>
<notempty name="com['statement_info'][0]['game_list']">
<td>{$com['statement_info'][0]['game_list'][0]['game_name']}</td>
<td>{$com['statement_info'][0]['game_list'][0]['game_type_name']}</td>
<!-- <td rowspan="{$com['statement_info'][0]['time_row']}">{$com['statement_info'][0]['time']}</td>-->
<td>{$com['statement_info'][0]['game_list'][0]['statement_begin_time']} ~ {$com['statement_info'][0]['game_list'][0]['statement_end_time']}</td>
<td><span class="pay_amount">{$com['statement_info'][0]['game_list'][0]['pay_amount']}</span></td>
<td>{$com['statement_info'][0]['game_list'][0]['ratio']}%</td>
<td>{$com['statement_info'][0]['game_list'][0]['increment_ratio']}%</td>
<td rowspan="{$com['statement_info'][0]['time_row']}">{$com['statement_info'][0]['reward']||default="0"}</td>
<td rowspan="{$com['statement_info'][0]['time_row']}">{$com['statement_info'][0]['fine']||default="0"}</td>
<td><span class="sum_money_span">{$com['statement_info'][0]['game_list'][0]['sum_money']}</span></td>
<else />
<td>-</td>
<td>-</td>
<td>-</td>
<td>-</td>
<td>-</td>
<td>-</td>
<td>-</td>
<td>-</td>
<td rowspan="{$com.row}">-</td>
<td rowspan="{$com.row}">-</td>
<td rowspan="{$com.row}">-</td>
</notempty>
<if condition="$com['is_payment'] eq 2">
<td rowspan="{$com.row}">{$com.company_info.payee_name}</td>
<td rowspan="{$com.row}">&nbsp;{$com.company_info.bank_account}</td>
<td rowspan="{$com.row}">{$com.company_info.opening_bank}</td>
</if>
</foreach>
<if condition="$com['is_payment'] eq 1">
<td rowspan="{$com.row}">{$com.company_info.ali_user}</td>
<td rowspan="{$com.row}">{$com.company_info.ali_account}</td>
<td rowspan="{$com.row}"></td>
</if>
<if condition="!$is_export">
<td rowspan="{$com.row}">
<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>
<if condition="$com['statement_info'][0]['row'] gt 1">
<foreach name="com['statement_info'][0]['game_list']" item="game" key="gamekey">
<if condition="$gamekey gt 0">
<tr>
<td>{$game['game_name']}</td>
<td>{$game['game_type_name']}</td>
<td><span class="pay_amount">{$game['pay_amount']}</span></td>
<td>{$game['ratio']}%</td>
<td>{$game['increment_ratio']}%</td>
<td><span class="sum_money_span">{$game['sum_money']}</span></td>
</tr>
</if>
</foreach>
</if>
<notempty name="com['statement_info'][1]">
<foreach name="com['statement_info']" item="account" key="akey">
<if condition="$akey gt 0">
<tr>
<td rowspan="{$account['row']}">{$account['account']}</td>
<notempty name="account['game_list']">
<td>{$account['game_list'][0]['game_name']}</td>
<td>{$account['game_list'][0]['game_type_name']}</td>
<notempty name="account['time']">
<td rowspan="{$account['time_row']}">{$account['time']|default="-----"}</td>
</notempty>
<td><span class="pay_amount">{$account['game_list'][0]['pay_amount']}</span></td>
<td>{$account['game_list'][0]['ratio']}%</td>
<td>{$account['game_list'][0]['increment_ratio']}%</td>
<td><span class="sum_money_span">{$account['game_list'][0]['sum_money']}</span></td>
<notempty name="account['time']">
<td rowspan="{$account['time_row']}">{$account['reward']|default=0}</td>
<td rowspan="{$account['time_row']}">{$account['fine']|default=0}</td>
</notempty>
<notempty name="account['time']">
<td rowspan="{$account['time_row']}">{$account['withhold_amount']|default=0}</td>
<td rowspan="{$account['time_row']}">{$account['week_amount']}</td>
</notempty>
<else />
<td>-</td>
<td>-</td>
<td>-</td>
<td>-</td>
<td>-</td>
<td>-</td>
<td>-</td>
<td>-</td>
<td>-</td>
<td>-</td>
<td>-</td>
<td>-</td>
</notempty>
</tr>
<if condition="$account['row'] gt 1">
<foreach name="account['game_list']" item="game" key="gamekey">
<if condition="$gamekey gt 0">
<tr>
<td>{$game['game_name']}</td>
<td>{$game['game_type_name']}</td>
<td><span class="pay_amount">{$game['pay_amount']}</span></td>
<td>{$game['ratio']}%</td>
<td>{$game['increment_ratio']}%</td>
<td><span class="sum_money_span">{$game['sum_money']}</span></td>
</tr>
</if>
</foreach>
</if>
</if>
</foreach>
</notempty>
</foreach>
<tr>
<td colspan=9 >合计:</td>

Loading…
Cancel
Save