master
chenzhi 5 years ago
parent c71c142227
commit fe7d21943b

@ -210,18 +210,20 @@ class CompanyStatementSetController extends Controller {
$add_data['pay_amount'] = 0; $add_data['pay_amount'] = 0;
$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'] =[];
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'];
$game['game_name'] =$ke;
//获取游戏id及比例 //获取游戏id及比例
$game_id = $GameDb->where("game_name='{$ke}' OR relation_game_name='{$ke}'")->field("id")->find(); $game_id = $GameDb->where("game_name='{$ke}' OR relation_game_name='{$ke}'")->field("id,relation_game_id")->find();
if(empty($game_id)){ if(empty($game_id)){
$game['id']=0; $game['relation_game_id']=0;
// $game['sum_money']=0; // $game['sum_money']=0;
$tratio = 0; $tratio = 0;
}else{ }else{
//获取比例 //获取比例
$game['id']=$game_id['id']; $game['relation_game_id']=$game_id['relation_game_id'];
if($type > 0){ if($type > 0){
$tratio = getGameCpRadio($game_id['id'],$va['pay_money'],true); $tratio = getGameCpRadio($game_id['id'],$va['pay_money'],true);
}else{ }else{
@ -236,19 +238,22 @@ class CompanyStatementSetController extends Controller {
$game['first_ratio']=100-$tratio; $game['first_ratio']=100-$tratio;
$game['second_ratio']=$tratio; $game['second_ratio']=$tratio;
} }
$add_data['pay_amount'] += $va['pay_money'];
$game['sum_money']=round($va['pay_money']*$tratio/100,2); $game['sum_money']=round($va['pay_money']*$tratio/100,2);
$add_data['statement_money'] += $game['sum_money'];
$game['fax_ratio']=0; $game['fax_ratio']=0;
$game['promote_ratio']=0; $game['promote_ratio']=0;
$game['statement_begin_time']=$statement_begin_time; $game['statement_begin_time']=$statement_begin_time;
$game['statement_end_time']=$statement_end_time; $game['statement_end_time']=$statement_end_time;
$game['statement_type']=0; $game['statement_type']=0;
dump($game); $add_data['statement_info'][] = $game;
} }
dd($v['list']); dd($add_data);
dd($v); dd($v);
//获取游戏比例 //获取游戏比例

Loading…
Cancel
Save