diff --git a/Application/Admin/Controller/CompanyStatementPoolController.class.php b/Application/Admin/Controller/CompanyStatementPoolController.class.php index 591c3d702..5e302f35c 100644 --- a/Application/Admin/Controller/CompanyStatementPoolController.class.php +++ b/Application/Admin/Controller/CompanyStatementPoolController.class.php @@ -193,23 +193,45 @@ class CompanyStatementPoolController extends ThinkController $line = 1; $count = []; //获取对接人 - $p_id = array_column($infolist,'company_id'); - $map['pc.id'] = ['in',$p_id]; - $pl = M("promote_company","tab_") - ->alias('pc') - ->field("pc.id,p.account,p.company_relation,s.nickname,pc.bank_address,pc.bank_name,pc.bank_card,pc.company_belong") - ->join("left join (select company_id,account,company_relation from tab_promote where level = 1 group by company_id ) p on p.company_id = pc.id") - ->join("left join sys_member s on s.uid = pc.uid") - ->where($map) - ->select(); - $Partner = []; - foreach($pl as $k=>$v){ - $Partner[$v['id']] = $v; - } - unset($pl); - + 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']); + $cline = $line+1; + if($is_export){ + $v['sum_money_exp'] = "="; + } + foreach($v['statement_info'] as $ke=>&$va){ + $line ++; + if(isset($va['ratio'])){ + $va['increment_ratio'] = 0; + }else{ + $va['ratio'] = 0; + } - // + 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['statement_count'] = count($v['statement_info']); + + } + if($is_export){ + $count["platform_amount"] = "=".trim($count["platform_amount_exp"],"+"); + $count["sum_money"] = "=".trim($count["sum_money_exp"],"+"); + } + $this->assign("data",$infolist); + $this->assign("count",$count); + $this->assign("is_export",$is_export); + $this->display("viewPuPool"); } //下游汇总结算查看 protected function viewPcPool(&$infolist,$is_export){ @@ -599,7 +621,10 @@ class CompanyStatementPoolController extends ThinkController default: break; } - + // + if($info['platform_amount'] <= 0){ + $optist = array_diff($optist, ["viewPool"]); + } if(empty($info['ext_file'])){ //未上传凭证 $optist = array_diff($optist, ["viewVoucher", "editVoucher"]); diff --git a/Application/Admin/View/CompanyStatementPool/viewPuPool.html b/Application/Admin/View/CompanyStatementPool/viewPuPool.html index 21e35d3e7..bae3145f7 100644 --- a/Application/Admin/View/CompanyStatementPool/viewPuPool.html +++ b/Application/Admin/View/CompanyStatementPool/viewPuPool.html @@ -123,44 +123,59 @@