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; }