diff --git a/Application/Admin/Controller/CompanyStatementController.class.php b/Application/Admin/Controller/CompanyStatementController.class.php index bd80d32d8..9e8230557 100644 --- a/Application/Admin/Controller/CompanyStatementController.class.php +++ b/Application/Admin/Controller/CompanyStatementController.class.php @@ -722,7 +722,7 @@ class CompanyStatementController extends ThinkController if($v['second_company_type'] == 1){ $up_company_id[] = $v['second_company_id']; }else{ - $dowm_company_id = $v['second_company_id']; + $dowm_company_id[] = $v['second_company_id']; } }else{ if($v['first_company_type'] == 1){ @@ -767,14 +767,14 @@ class CompanyStatementController extends ThinkController $stime = strtotime($date); $w = (int)date("w",strtotime($date)); $d = (int)date("d",strtotime($date)); - if($w == 1){ - if(!empty($up_company_id)){ - $CompanyStatementSet->cpStatement(0,$stime,$up_company_id,false); - } - if(!empty($dowm_company_id)){ - $CompanyStatementSet->promoteCompanyStatement(0,$stime,$dowm_company_id,false); - } - } + // if($w == 1){ + // if(!empty($up_company_id)){ + // $CompanyStatementSet->cpStatement(0,$stime,$up_company_id,false); + // } + // if(!empty($dowm_company_id)){ + // $CompanyStatementSet->promoteCompanyStatement(0,$stime,$dowm_company_id,false); + // } + // } if($d == 1){ if(!empty($up_company_id)){ $CompanyStatementSet->cpStatement(1,$stime,$up_company_id,false); @@ -782,7 +782,7 @@ class CompanyStatementController extends ThinkController } if(!empty($dowm_company_id)){ $CompanyStatementSet->promoteCompanyStatement(1,$stime,$dowm_company_id,false); - $CompanyStatementSet->promoteCompanyStatement(2,$stime,$dowm_company_id,false); + // $CompanyStatementSet->promoteCompanyStatement(2,$stime,$dowm_company_id,false); } } diff --git a/Application/Admin/Controller/CompanyStatementSetController.class.php b/Application/Admin/Controller/CompanyStatementSetController.class.php index 3d3b16a36..6c520083e 100644 --- a/Application/Admin/Controller/CompanyStatementSetController.class.php +++ b/Application/Admin/Controller/CompanyStatementSetController.class.php @@ -241,6 +241,7 @@ class CompanyStatementSetController extends Controller { $promote_ratio = $cp[$add_data['company_id']]['channel_rate'] ?? 0; $fax_ratio = $cp[$add_data['company_id']]['invoice_rate'] ?? 0; //游戏统计 + if(!isset($v['list'])){continue;} foreach($v['list'] as $ke=>$va){ $game =[]; $game['pay_amount'] =$va['pay_money']; @@ -425,7 +426,6 @@ class CompanyStatementSetController extends Controller { $where['settlement_type']=1; $pcDbRes = M("CompanyRelation","tab_")->where($where)->select(); } - $pcList=[]; $js_id = [];//己方公司 foreach ($pcDbRes as $k => $v) { @@ -452,6 +452,7 @@ class CompanyStatementSetController extends Controller { foreach ($tmpp as $v) { $pc[$v['id']]=$v; } + unset($tmpp); //获取己方公司 $our = []; @@ -469,7 +470,9 @@ class CompanyStatementSetController extends Controller { $statement_begin_time = date("Y-m-d",$begintime); $statement_end_time = date("Y-m-d",$endtime); $RewardRecord = M("RewardRecord","tab_"); + foreach($pcList as $k=>$v){ + if(!isset($pc[$k])){continue;}//不存在的公司不结算 $add_data=[]; @@ -509,8 +512,7 @@ class CompanyStatementSetController extends Controller { $company_belong = $pc[$add_data['company_id']]['company_belong']; $add_data['company_belong']=$company_belong; $add_data['company_type']=$pc[$add_data['company_id']]['company_type']; - - + if(!isset($v['list'])){continue;} //游戏统计 foreach($v['list'] as $ke=>$va){ $game =[]; @@ -597,20 +599,13 @@ class CompanyStatementSetController extends Controller { if($add_data['platform_amount'] <= 0){ return; } + // dd($add_data); //添加 if($recount && $company_id !== false){ //非重算 return $add_data; } $StatementDb->add($add_data); - - - // if($company_id === false){ - // //非重算 - // $StatementDb->add($add_data); - // }else{ - // return $add_data; - // } } } //设定开始结束时间 @@ -763,6 +758,7 @@ class CompanyStatementSetController extends Controller { $v['fine'] = 0; $v['reward'] = 0; $v['platform_amount'] = 0; + if(!isset($v['list'])){continue;} foreach($v['list'] as $ke=>$va){ $game =[]; $game['pay_amount'] =$va['pay_amount'];