From 16a3bea1720aa3393d475d0fc2e133dc5e0af5b1 Mon Sep 17 00:00:00 2001 From: chenzhi <294767167@11qq.com> Date: Sat, 25 Jul 2020 09:21:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=B8=8A=E6=B8=B8=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E6=9C=8D=E5=8A=A1=E5=99=A8=E8=B4=B9=E7=94=A8=E7=BB=93?= =?UTF-8?q?=E7=AE=97=E5=8C=85=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CompanyStatementSetController.class.php | 29 ++++++++++++++----- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/Application/Admin/Controller/CompanyStatementSetController.class.php b/Application/Admin/Controller/CompanyStatementSetController.class.php index d0c97716d..1fabbaef7 100644 --- a/Application/Admin/Controller/CompanyStatementSetController.class.php +++ b/Application/Admin/Controller/CompanyStatementSetController.class.php @@ -143,7 +143,7 @@ class CompanyStatementSetController extends Controller { $cp_id = implode(",",array_flip(array_flip(array_keys($cpList)))); $js_id = implode(",",array_unique($js_id)); //获取cp公司 - $tmpp = M("Partner","tab_")->field("id,partner,link_man,link_phone,address,company_tax_no,payee_name,bank_account,opening_bank,channel_rate,invoice_rate,company_type,ali_user,ali_account")->where(["id"=>['in',$cp_id]])->select(); + $tmpp = M("Partner","tab_")->field("id,partner,link_man,link_phone,address,company_tax_no,payee_name,bank_account,opening_bank,channel_rate,invoice_rate,company_type,ali_user,ali_account,has_advance_charge,has_server_fee")->where(["id"=>['in',$cp_id]])->select(); $cp =[]; foreach ($tmpp as $v) { $cp[$v['id']]=$v; @@ -298,14 +298,15 @@ class CompanyStatementSetController extends Controller { if($type < 2){ //非补点奖罚 $rrmap = array( - "reward_time" => ['between', [$begintime,$endtime]], + "confirm_time" => ['between', [$begintime,$endtime]], "company_type"=>1, - "company_id"=>$add_data['company_id'] + "company_id"=>$add_data['company_id'], + "settlement_type"=>2, ); - $rfres = M("RewardRecord","tab_") + $rfres = M("RewardDetail","tab_") ->field(" - IFNULL(SUM(CASE WHEN reward_type = 1 THEN money ELSE 0 END),0) as reward_count, - IFNULL(SUM(CASE WHEN reward_type = 2 THEN money ELSE 0 END),0) as fine_count + IFNULL(SUM(CASE WHEN type = 1 THEN amount ELSE 0 END),0) as reward_count, + IFNULL(SUM(CASE WHEN type = 2 THEN amount ELSE 0 END),0) as fine_count ") ->where($rrmap)->find(); if($rfres['reward_count'] > 0){ @@ -333,7 +334,21 @@ class CompanyStatementSetController extends Controller { ); $add_data['statement_money'] -= $fine_count; $add_data['pay_amount'] -= $fine_count;; - } + } + //获取服务器费用 + if($v['has_server_fee'] == 1 && $v['server_fee'] >0){ + $server_count = $v['server_fee']; + $add_data['statement_info'][] = array( + "statement_begin_time"=>$statement_begin_time, + "statement_end_time"=>$statement_end_time, + 'statement_type'=>1, + "game_name"=>"服务器费用", + 'pay_amount'=>$server_count, + 'sum_money'=>$server_count, + ); + $add_data['statement_money'] -= $server_count; + $add_data['pay_amount'] -= $server_count;; + } } $add_data['statement_info'] = json_encode($add_data['statement_info'],JSON_UNESCAPED_UNICODE);