From 7ed2855dc5a6cc64145b0f1e3722a3b06dcd6ac5 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Mon, 8 Mar 2021 20:15:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=87=8D=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/CompanyStatementController.class.php | 6 +++++- .../SubCompanyStatementSetController.class.php | 11 ++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Application/Admin/Controller/CompanyStatementController.class.php b/Application/Admin/Controller/CompanyStatementController.class.php index cdf156e96..cbc15fca6 100644 --- a/Application/Admin/Controller/CompanyStatementController.class.php +++ b/Application/Admin/Controller/CompanyStatementController.class.php @@ -1016,7 +1016,11 @@ class CompanyStatementController extends ThinkController // if(in_array($v['verify_status'],[3,4])) continue; //合作方确认后不进行重算 //重算 if ($v['withdraw_type']!=3) { - $res = A("CompanyStatementSet")->updateCompanyStatementData($v['id'],$this->admininfo["username"]); + if(IS_SUBSITE){ + $res = A("SubCompanyStatementSet")->updateCompanyStatementData($v['id'],$this->admininfo["username"]); + }else{ + $res = A("CompanyStatementSet")->updateCompanyStatementData($v['id'],$this->admininfo["username"]); + } if($res === false){ $this->ajaxReturn(array( 'status' => 0, diff --git a/Application/Admin/Controller/SubCompanyStatementSetController.class.php b/Application/Admin/Controller/SubCompanyStatementSetController.class.php index 75375b3a0..817319353 100644 --- a/Application/Admin/Controller/SubCompanyStatementSetController.class.php +++ b/Application/Admin/Controller/SubCompanyStatementSetController.class.php @@ -277,7 +277,6 @@ class SubCompanyStatementSetController extends Controller { $add_data['verify_log'] = $verify_log; $add_data['op_time'] =time(); $add_data['statement_info'] = json_encode($add_data['statement_info'],JSON_UNESCAPED_UNICODE); - //添加 if($recount && $company_id !== false){ //非重算 @@ -324,13 +323,17 @@ class SubCompanyStatementSetController extends Controller { $cplList = []; foreach ($gameList as $k => $v) { if($v['pay_money'] <= 0) continue; //0值不发送 + //兼容旧数据的上游结算 + $hasOtherName = false; if(empty($v['original_package_name'])){ $game_name = $v['game_name']; }else{ if($v['select_package_name'] == 0){ $game_name = $v['original_package_name']; + $hasOtherName = $v['game_name']; }else{ $game_name = $v['game_name']; + $hasOtherName = $v['original_package_name']; } } $cp_id = $v['cp_id']; @@ -339,6 +342,12 @@ class SubCompanyStatementSetController extends Controller { $cplList[$cp_id]['list'][$game_name]["pay_money"] =$ymoney+$v["pay_money"]; $cplList[$cp_id]['list'][$game_name]["platform_money"] = $cplList[$cp_id]['list'][$game_name]["pay_money"]; $cplList[$cp_id]['list'][$game_name]["aggregate_money"] = 0; + //兼容旧数据结算,旧数据有可能不使用原包名结算 + if($hasOtherName !== false){ + $cplList[$cp_id]['list'][$hasOtherName]["pay_money"] = $cplList[$cp_id]['list'][$game_name]["pay_money"]; + $cplList[$cp_id]['list'][$hasOtherName]["platform_money"] = $cplList[$cp_id]['list'][$game_name]["platform_money"]; + $cplList[$cp_id]['list'][$hasOtherName]["aggregate_money"] = $cplList[$cp_id]['list'][$game_name]["aggregate_money"]; + } } return $cplList; }