新增个人聚合

master
chenzhi 4 years ago
parent f2ce52ada5
commit 7d3e90514f

@ -746,7 +746,6 @@ class CompanyStatementSetController extends Controller {
"pay_amount"=>0,
"statement_money"=>0,
"platform_amount"=>0,
"statement_ids"=>[],
"create_lack_ids"=>[],
"del_lack_ids"=>[],
"statement_begin_time"=>$begintime,
@ -754,6 +753,7 @@ class CompanyStatementSetController extends Controller {
"fine"=>0,
"reward"=>0,
"verify_status"=>0,
"company_type"=>2,
"verify_log"=>json_encode(["create_user"=>"system","create_time"=>date("Y-m-d H:i:s")]),
"op_time"=>time()
];
@ -805,7 +805,7 @@ class CompanyStatementSetController extends Controller {
$game['ratio']=$tratio;
}
$v['pay_amount'] += $va['pay_amount'];
$v['platform_amount'] += $va['platform_amount'];
$v['platform_amount'] += $va['pay_amount'];
//判断是否是个人
if($type < 2){
//非补点
@ -870,11 +870,14 @@ class CompanyStatementSetController extends Controller {
$del_lack_ids[] = $val['id'];
$v['statement_money'] += $val['statement_money'];
$v['pay_amount'] = $val['pay_amount'];
$v['fine'] = $val['fine'];
$v['reward'] = $val['reward'];
$v['platform_amount'] = $val['platform_amount'];
$v['pay_amount'] += $val['pay_amount'];
$v['fine'] += $val['fine'];
$v['reward'] += $val['reward'];
$v['platform_amount'] += $val['platform_amount'];
$v['statement_info'] = array_merge($v['statement_info'],json_decode($val['statement_info'],true));
$last_names = array_column($v['statement_info'],'game_name');
array_multisort($last_names,SORT_DESC,SORT_STRING,$v['statement_info']);
}
}
if($v['statement_money'] < 300){
@ -884,6 +887,7 @@ class CompanyStatementSetController extends Controller {
}else{
//存成功
$company =[
"pool_id"=>0,
"company_id"=>$k,
"company_type"=>2,
"company_name"=>$v['partner'],
@ -897,15 +901,33 @@ class CompanyStatementSetController extends Controller {
"statement_end_time"=>$endtime,
"statement_info"=>json_encode($v['statement_info'],JSON_UNESCAPED_UNICODE)
];
$companyid = $StatementInfo->add($lackcompany);
$companyid = $StatementInfo->add($company);
$countdata['info_ids'][] =$companyid;
$countdata['del_lack_ids'] =array_merge($countdata['del_lack_ids'],$del_lack_ids);
$countdata['statement_money'] +=$v['statement_money'];
$countdata['pay_amount'] +=$v['pay_amount'];
$countdata['platform_amount'] +=$v['platform_amount'];
$countdata['fine'] +=$v['fine'];
$countdata['reward'] +=$v['reward'];
}
}
dump($users);
dd($user);
$this->savePromotateUserPool($users);
$this->savePromotateUserPool($user);
}
/**
* 保存信息汇总信息
*/
protected function savePromotateUserPool($data){
if(empty($data['create_lack_ids']) && empty($data['del_lack_ids']) && empty($data['info_ids'])){ return;}
$data['create_lack_ids'] = implode(",",$data['create_lack_ids']);
$data['del_lack_ids'] = implode(",",$data['del_lack_ids']);
$info = implode(",",$data['info_ids']);
unset($data['info_ids']);
$id = M("company_statement_pool","tab_")->add($data);
//回写
$save["pool_id"]=$id;
M("company_statement_info","tab_")->where("id in ({$info})")->save($save);
}
/**

Loading…
Cancel
Save