优化奖罚符号问题

master
chenzhi 5 years ago
parent 29618ce878
commit 1f5944c0a4

@ -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);

@ -391,12 +391,8 @@
<tr>
<td>${it.statement_begin_time}~${it.statement_end_time}</td>
<td>${it.game_name}</td>
{@if it.statement_type==1}
<td>-${it.pay_amount}元</td>
{@else}
<td>${it.pay_amount}元</td>
{@/if}
<td>${it.pay_amount}元</td>
{@if it.statement_type==0}
<td><input type="text" class="txt statementchange" name="first_ratio" data-index ="${index}" data-change="statement_info[${index}]['first_ratio']" value="${it.first_ratio}" style="width: 40px;">%</td>
<td><input type="text" class="txt statementchange" name="second_ratio" data-index ="${index}" data-change="statement_info[${index}]['second_ratio']" value="${it.second_ratio}" style="width: 40px;">%</td>
@ -409,11 +405,7 @@
<td></td>
{@/if}
{@if it.statement_type==1}
<td>-${it.sum_money}元</td>
{@else}
<td>${it.sum_money}元</td>
{@/if}
<td>${it.sum_money}元</td>
</tr>
{@/each}

@ -386,11 +386,7 @@
<tr>
<td>${it.statement_begin_time}~${it.statement_end_time}</td>
<td>${it.game_name}</td>
{@if it.statement_type==1}
<td>-${it.pay_amount}元</td>
{@else}
<td>${it.pay_amount}元</td>
{@/if}
<td>${it.pay_amount}元</td>
{@if it.statement_type==0}
<td><input type="text" class="txt statementchange" name="first_ratio" data-index ="${index}" data-change="statement_info[${index}]['first_ratio']" value="${it.first_ratio}" style="width: 40px;">%</td>
@ -403,12 +399,8 @@
<td></td>
<td></td>
{@/if}
{@if it.statement_type==1}
<td>-${it.sum_money}元</td>
{@else}
<td>${it.sum_money}元</td>
{@/if}
<td>${it.sum_money}元</td>
</tr>
{@/each}

Loading…
Cancel
Save