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 @@