|
|
|
@ -208,17 +208,36 @@ class StatementController extends ThinkController
|
|
|
|
|
IFNULL(SUM(CASE WHEN reward_type = 2 THEN money ELSE 0 END),0) as fine_count
|
|
|
|
|
")
|
|
|
|
|
->where($rrmap)->find();
|
|
|
|
|
if($statement_type == 0 ){
|
|
|
|
|
//乙->甲 甲方cp
|
|
|
|
|
if($first_partner_type==0){
|
|
|
|
|
$reward_count = $rfres['reward_count']-0;
|
|
|
|
|
$fine_count = 0-$rfres['fine_count'];
|
|
|
|
|
}else{
|
|
|
|
|
$reward_count = 0-$rfres['reward_count'];
|
|
|
|
|
$fine_count = $rfres['fine_count']-0;
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
if($first_partner_type==0){
|
|
|
|
|
$reward_count = 0-$rfres['reward_count']-0;
|
|
|
|
|
$fine_count = $rfres['fine_count']-0;
|
|
|
|
|
}else{
|
|
|
|
|
$reward_count = $rfres['reward_count']-0;
|
|
|
|
|
$fine_count = 0-$rfres['fine_count'];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if($rfres['reward_count'] > 0){
|
|
|
|
|
$list[] = array(
|
|
|
|
|
"statement_begin_time"=>$_REQUEST['time_start'],
|
|
|
|
|
"statement_end_time"=>$_REQUEST['time_end'],
|
|
|
|
|
'statement_type'=>2,
|
|
|
|
|
"game_name"=>"奖励",
|
|
|
|
|
'pay_amount'=>$rfres['reward_count'],
|
|
|
|
|
'sum_money'=>$rfres['reward_count'],
|
|
|
|
|
'pay_amount'=>$reward_count,
|
|
|
|
|
'sum_money'=>$reward_count,
|
|
|
|
|
);
|
|
|
|
|
$countarr['pay_amount'] +=$rfres['reward_count'];
|
|
|
|
|
$countarr['sum_money']+=$rfres['reward_count'];
|
|
|
|
|
$countarr['pay_amount'] +=$reward_count;
|
|
|
|
|
$countarr['sum_money']+=$reward_count;
|
|
|
|
|
}
|
|
|
|
|
if($rfres['fine_count'] > 0){
|
|
|
|
|
$list[] = array(
|
|
|
|
@ -226,11 +245,11 @@ class StatementController extends ThinkController
|
|
|
|
|
"statement_end_time"=>$_REQUEST['time_end'],
|
|
|
|
|
'statement_type'=>1,
|
|
|
|
|
"game_name"=>"罚款",
|
|
|
|
|
'pay_amount'=>$rfres['fine_count'],
|
|
|
|
|
'sum_money'=>$rfres['fine_count'],
|
|
|
|
|
'pay_amount'=>$fine_count,
|
|
|
|
|
'sum_money'=>$fine_count,
|
|
|
|
|
);
|
|
|
|
|
$countarr['pay_amount'] -= $rfres['fine_count'];
|
|
|
|
|
$countarr['sum_money'] -= $rfres['fine_count'];
|
|
|
|
|
$countarr['pay_amount'] += $fine_count;
|
|
|
|
|
$countarr['sum_money'] += $fine_count;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$countarr['pay_amount'] = round($countarr['pay_amount'],2);
|
|
|
|
|