|
|
@ -241,6 +241,7 @@ class CompanyStatementSetController extends Controller {
|
|
|
|
$promote_ratio = $cp[$add_data['company_id']]['channel_rate'] ?? 0;
|
|
|
|
$promote_ratio = $cp[$add_data['company_id']]['channel_rate'] ?? 0;
|
|
|
|
$fax_ratio = $cp[$add_data['company_id']]['invoice_rate'] ?? 0;
|
|
|
|
$fax_ratio = $cp[$add_data['company_id']]['invoice_rate'] ?? 0;
|
|
|
|
//游戏统计
|
|
|
|
//游戏统计
|
|
|
|
|
|
|
|
if(!isset($v['list'])){continue;}
|
|
|
|
foreach($v['list'] as $ke=>$va){
|
|
|
|
foreach($v['list'] as $ke=>$va){
|
|
|
|
$game =[];
|
|
|
|
$game =[];
|
|
|
|
$game['pay_amount'] =$va['pay_money'];
|
|
|
|
$game['pay_amount'] =$va['pay_money'];
|
|
|
@ -425,7 +426,6 @@ class CompanyStatementSetController extends Controller {
|
|
|
|
$where['settlement_type']=1;
|
|
|
|
$where['settlement_type']=1;
|
|
|
|
$pcDbRes = M("CompanyRelation","tab_")->where($where)->select();
|
|
|
|
$pcDbRes = M("CompanyRelation","tab_")->where($where)->select();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$pcList=[];
|
|
|
|
$pcList=[];
|
|
|
|
$js_id = [];//己方公司
|
|
|
|
$js_id = [];//己方公司
|
|
|
|
foreach ($pcDbRes as $k => $v) {
|
|
|
|
foreach ($pcDbRes as $k => $v) {
|
|
|
@ -452,6 +452,7 @@ class CompanyStatementSetController extends Controller {
|
|
|
|
foreach ($tmpp as $v) {
|
|
|
|
foreach ($tmpp as $v) {
|
|
|
|
$pc[$v['id']]=$v;
|
|
|
|
$pc[$v['id']]=$v;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
unset($tmpp);
|
|
|
|
unset($tmpp);
|
|
|
|
//获取己方公司
|
|
|
|
//获取己方公司
|
|
|
|
$our = [];
|
|
|
|
$our = [];
|
|
|
@ -469,7 +470,9 @@ class CompanyStatementSetController extends Controller {
|
|
|
|
$statement_begin_time = date("Y-m-d",$begintime);
|
|
|
|
$statement_begin_time = date("Y-m-d",$begintime);
|
|
|
|
$statement_end_time = date("Y-m-d",$endtime);
|
|
|
|
$statement_end_time = date("Y-m-d",$endtime);
|
|
|
|
$RewardRecord = M("RewardRecord","tab_");
|
|
|
|
$RewardRecord = M("RewardRecord","tab_");
|
|
|
|
|
|
|
|
|
|
|
|
foreach($pcList as $k=>$v){
|
|
|
|
foreach($pcList as $k=>$v){
|
|
|
|
|
|
|
|
|
|
|
|
if(!isset($pc[$k])){continue;}//不存在的公司不结算
|
|
|
|
if(!isset($pc[$k])){continue;}//不存在的公司不结算
|
|
|
|
|
|
|
|
|
|
|
|
$add_data=[];
|
|
|
|
$add_data=[];
|
|
|
@ -509,8 +512,7 @@ class CompanyStatementSetController extends Controller {
|
|
|
|
$company_belong = $pc[$add_data['company_id']]['company_belong'];
|
|
|
|
$company_belong = $pc[$add_data['company_id']]['company_belong'];
|
|
|
|
$add_data['company_belong']=$company_belong;
|
|
|
|
$add_data['company_belong']=$company_belong;
|
|
|
|
$add_data['company_type']=$pc[$add_data['company_id']]['company_type'];
|
|
|
|
$add_data['company_type']=$pc[$add_data['company_id']]['company_type'];
|
|
|
|
|
|
|
|
if(!isset($v['list'])){continue;}
|
|
|
|
|
|
|
|
|
|
|
|
//游戏统计
|
|
|
|
//游戏统计
|
|
|
|
foreach($v['list'] as $ke=>$va){
|
|
|
|
foreach($v['list'] as $ke=>$va){
|
|
|
|
$game =[];
|
|
|
|
$game =[];
|
|
|
@ -597,20 +599,13 @@ class CompanyStatementSetController extends Controller {
|
|
|
|
if($add_data['platform_amount'] <= 0){
|
|
|
|
if($add_data['platform_amount'] <= 0){
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// dd($add_data);
|
|
|
|
//添加
|
|
|
|
//添加
|
|
|
|
if($recount && $company_id !== false){
|
|
|
|
if($recount && $company_id !== false){
|
|
|
|
//非重算
|
|
|
|
//非重算
|
|
|
|
return $add_data;
|
|
|
|
return $add_data;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$StatementDb->add($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['fine'] = 0;
|
|
|
|
$v['reward'] = 0;
|
|
|
|
$v['reward'] = 0;
|
|
|
|
$v['platform_amount'] = 0;
|
|
|
|
$v['platform_amount'] = 0;
|
|
|
|
|
|
|
|
if(!isset($v['list'])){continue;}
|
|
|
|
foreach($v['list'] as $ke=>$va){
|
|
|
|
foreach($v['list'] as $ke=>$va){
|
|
|
|
$game =[];
|
|
|
|
$game =[];
|
|
|
|
$game['pay_amount'] =$va['pay_amount'];
|
|
|
|
$game['pay_amount'] =$va['pay_amount'];
|
|
|
|