From 1f5944c0a44d2840caf86e9db9686523e644baf7 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Fri, 7 Feb 2020 12:38:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=A5=96=E7=BD=9A=E7=AC=A6?= =?UTF-8?q?=E5=8F=B7=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/StatementController.class.php | 35 ++++++++++++++----- .../View/Statement/createCpStatement.html | 14 ++------ .../Admin/View/Statement/editCpStatement.html | 14 ++------ 3 files changed, 33 insertions(+), 30 deletions(-) diff --git a/Application/Admin/Controller/StatementController.class.php b/Application/Admin/Controller/StatementController.class.php index 69042b87d..6c3eb2777 100644 --- a/Application/Admin/Controller/StatementController.class.php +++ b/Application/Admin/Controller/StatementController.class.php @@ -208,17 +208,36 @@ class StatementController extends ThinkController IFNULL(SUM(CASE WHEN reward_type = 2 THEN money ELSE 0 END),0) as fine_count ") ->where($rrmap)->find(); + if($statement_type == 0 ){ + //乙->甲 甲方cp + if($first_partner_type==0){ + $reward_count = $rfres['reward_count']-0; + $fine_count = 0-$rfres['fine_count']; + }else{ + $reward_count = 0-$rfres['reward_count']; + $fine_count = $rfres['fine_count']-0; + } + }else{ + if($first_partner_type==0){ + $reward_count = 0-$rfres['reward_count']-0; + $fine_count = $rfres['fine_count']-0; + }else{ + $reward_count = $rfres['reward_count']-0; + $fine_count = 0-$rfres['fine_count']; + } + } + if($rfres['reward_count'] > 0){ $list[] = array( "statement_begin_time"=>$_REQUEST['time_start'], "statement_end_time"=>$_REQUEST['time_end'], 'statement_type'=>2, "game_name"=>"奖励", - 'pay_amount'=>$rfres['reward_count'], - 'sum_money'=>$rfres['reward_count'], + 'pay_amount'=>$reward_count, + 'sum_money'=>$reward_count, ); - $countarr['pay_amount'] +=$rfres['reward_count']; - $countarr['sum_money']+=$rfres['reward_count']; + $countarr['pay_amount'] +=$reward_count; + $countarr['sum_money']+=$reward_count; } if($rfres['fine_count'] > 0){ $list[] = array( @@ -226,11 +245,11 @@ class StatementController extends ThinkController "statement_end_time"=>$_REQUEST['time_end'], 'statement_type'=>1, "game_name"=>"罚款", - 'pay_amount'=>$rfres['fine_count'], - 'sum_money'=>$rfres['fine_count'], + 'pay_amount'=>$fine_count, + 'sum_money'=>$fine_count, ); - $countarr['pay_amount'] -= $rfres['fine_count']; - $countarr['sum_money'] -= $rfres['fine_count']; + $countarr['pay_amount'] += $fine_count; + $countarr['sum_money'] += $fine_count; } $countarr['pay_amount'] = round($countarr['pay_amount'],2); diff --git a/Application/Admin/View/Statement/createCpStatement.html b/Application/Admin/View/Statement/createCpStatement.html index ed7f3cc8c..56e1016d4 100644 --- a/Application/Admin/View/Statement/createCpStatement.html +++ b/Application/Admin/View/Statement/createCpStatement.html @@ -391,12 +391,8 @@ ${it.statement_begin_time}~${it.statement_end_time} ${it.game_name} - {@if it.statement_type==1} - -${it.pay_amount}元 - {@else} - ${it.pay_amount}元 - {@/if} - + ${it.pay_amount}元 + {@if it.statement_type==0} % % @@ -409,11 +405,7 @@ {@/if} - {@if it.statement_type==1} - -${it.sum_money}元 - {@else} - ${it.sum_money}元 - {@/if} + ${it.sum_money}元 {@/each} diff --git a/Application/Admin/View/Statement/editCpStatement.html b/Application/Admin/View/Statement/editCpStatement.html index bb556b931..04587a8d8 100644 --- a/Application/Admin/View/Statement/editCpStatement.html +++ b/Application/Admin/View/Statement/editCpStatement.html @@ -386,11 +386,7 @@ ${it.statement_begin_time}~${it.statement_end_time} ${it.game_name} - {@if it.statement_type==1} - -${it.pay_amount}元 - {@else} - ${it.pay_amount}元 - {@/if} + ${it.pay_amount}元 {@if it.statement_type==0} % @@ -403,12 +399,8 @@ {@/if} - - {@if it.statement_type==1} - -${it.sum_money}元 - {@else} - ${it.sum_money}元 - {@/if} + + ${it.sum_money}元 {@/each}