提交 9432d2e6 authored 作者: chengye's avatar chengye

修复账单明细显示数据错误

上级 89ea5b90
...@@ -130,7 +130,7 @@ class EmInvoice extends Base ...@@ -130,7 +130,7 @@ class EmInvoice extends Base
//峰谷表 //峰谷表
if($inv['type'] !== 5){ if($inv['type'] != 5){
$ud = UseageDetail::field('*,case type $ud = UseageDetail::field('*,case type
when 1 then "尖峰段" when 1 then "尖峰段"
when 2 then "峰段" when 2 then "峰段"
...@@ -163,6 +163,12 @@ class EmInvoice extends Base ...@@ -163,6 +163,12 @@ class EmInvoice extends Base
$totle['repo_numb'] += $u->repo_numb; $totle['repo_numb'] += $u->repo_numb;
$totle['amount'] += $u->amount; $totle['amount'] += $u->amount;
$totle['settle_amount'] += $u->repo_numb*$totle['settle_price']; $totle['settle_amount'] += $u->repo_numb*$totle['settle_price'];
if($inv->em->emr->settle_price != ''){
$totle['settle_amount'] = $totle['repo_numb'] * $totle['settle_price'];
}
else{
$totle['settle_amount'] = $inv->settle_amount ?: 0;
}
} }
$inv->useage->ud = $ud; $inv->useage->ud = $ud;
} else { //包年包月 } else { //包年包月
...@@ -180,6 +186,14 @@ class EmInvoice extends Base ...@@ -180,6 +186,14 @@ class EmInvoice extends Base
} }
} }
$inv->useage->totle = $totle; $inv->useage->totle = $totle;
} else {
$totle = [];
if($inv->em->emr->settle_price != ''){
$totle['settle_amount'] = $inv->em->emr->settle_price * $inv->repo_numb ;
}
else{
$totle['settle_amount'] = 0;
}
} }
return $inv; return $inv;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论