From 88c70c29db3d5caeae27fd7382c3892c894887e1 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Fri, 12 Jun 2020 09:38:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E0=E4=B8=8D=E6=9F=A5=E7=9C=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CompanyStatementPoolController.class.php | 59 +++++++++++++------ .../View/CompanyStatementPool/viewPuPool.html | 55 ++++++++++------- 2 files changed, 77 insertions(+), 37 deletions(-) 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 @@ {$key-0+1} {$com.company_name} + + {$com.company_info.account} + {$com.company_info.company_relation_str} + {$com.company_info.nickname} + {$com.company_info.company_type_str} + {$com['statement_info'][0]['game_name']} - {$com['statement_info'][0]['pay_amount']} - {$com['statement_info'][0]['ratio']}% - {$com['statement_info'][0]['increment_ratio']}% - {$com['statement_info'][0]['fax_ratio']}% - {$com['statement_info'][0]['d_statement_money']} - {$com.fine} - {$com.reward} - {$com.statement_money} - {$com.settlement_contact} + {$com['statement_info'][0]['game_type_name']} {$com['statement_info'][0]['statement_begin_time']} ~ {$com['statement_info'][0]['statement_end_time']} - {$com.renark} + {$com['statement_info'][0]['pay_amount']} + + {$com['statement_info'][0]['ratio']|default=0}% + {$com['statement_info'][0]['increment_ratio']|default=0}% + {$com['statement_info'][0]['reward']} + {$com['statement_info'][0]['fine']} + {$com['statement_info'][0]['sum_money']} + + {$com.company_info.payee_name} + {$com.company_info.bank_account} + {$com.company_info.opening_bank} + + {$com.remark} {$it['game_name']} - {$it['pay_amount']} - {$it['ratio']}% - {$it['increment_ratio']}% - {$it['fax_ratio']}% - {$it['d_statement_money']} + {$it['game_type_name']} {$it['statement_begin_time']} ~ {$it['statement_end_time']} + {$it['pay_amount']} + + {$it['ratio']|default=0}% + {$it['increment_ratio']|default=0}% + {$it['reward']} + {$it['fine']} + {$it['sum_money']} + - 合计: + 合计: {$count.platform_amount} - {$count.d_statement_money} - {$count.fine} - {$count.reward} - {$count.statement_money} + + {$count.sum_money} + + +