优化重算

master
chenzhi 4 years ago
parent 708707a15a
commit 7ed2855dc5

@ -1016,7 +1016,11 @@ class CompanyStatementController extends ThinkController
// if(in_array($v['verify_status'],[3,4])) continue; //合作方确认后不进行重算 // if(in_array($v['verify_status'],[3,4])) continue; //合作方确认后不进行重算
//重算 //重算
if ($v['withdraw_type']!=3) { if ($v['withdraw_type']!=3) {
if(IS_SUBSITE){
$res = A("SubCompanyStatementSet")->updateCompanyStatementData($v['id'],$this->admininfo["username"]);
}else{
$res = A("CompanyStatementSet")->updateCompanyStatementData($v['id'],$this->admininfo["username"]); $res = A("CompanyStatementSet")->updateCompanyStatementData($v['id'],$this->admininfo["username"]);
}
if($res === false){ if($res === false){
$this->ajaxReturn(array( $this->ajaxReturn(array(
'status' => 0, 'status' => 0,

@ -277,7 +277,6 @@ class SubCompanyStatementSetController extends Controller {
$add_data['verify_log'] = $verify_log; $add_data['verify_log'] = $verify_log;
$add_data['op_time'] =time(); $add_data['op_time'] =time();
$add_data['statement_info'] = json_encode($add_data['statement_info'],JSON_UNESCAPED_UNICODE); $add_data['statement_info'] = json_encode($add_data['statement_info'],JSON_UNESCAPED_UNICODE);
//添加 //添加
if($recount && $company_id !== false){ if($recount && $company_id !== false){
//非重算 //非重算
@ -324,13 +323,17 @@ class SubCompanyStatementSetController extends Controller {
$cplList = []; $cplList = [];
foreach ($gameList as $k => $v) { foreach ($gameList as $k => $v) {
if($v['pay_money'] <= 0) continue; //0值不发送 if($v['pay_money'] <= 0) continue; //0值不发送
//兼容旧数据的上游结算
$hasOtherName = false;
if(empty($v['original_package_name'])){ if(empty($v['original_package_name'])){
$game_name = $v['game_name']; $game_name = $v['game_name'];
}else{ }else{
if($v['select_package_name'] == 0){ if($v['select_package_name'] == 0){
$game_name = $v['original_package_name']; $game_name = $v['original_package_name'];
$hasOtherName = $v['game_name'];
}else{ }else{
$game_name = $v['game_name']; $game_name = $v['game_name'];
$hasOtherName = $v['original_package_name'];
} }
} }
$cp_id = $v['cp_id']; $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]["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]["platform_money"] = $cplList[$cp_id]['list'][$game_name]["pay_money"];
$cplList[$cp_id]['list'][$game_name]["aggregate_money"] = 0; $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; return $cplList;
} }

Loading…
Cancel
Save