提交 904ce971 authored 作者: chengye's avatar chengye

修复账单缴费余额与结算余额错误

上级 32fa02df
...@@ -13,3 +13,7 @@ ...@@ -13,3 +13,7 @@
/README.md /README.md
/think /think
/config/database.php /config/database.php
/public/dist/*
/public/dist2/*
/public/static/uploads/*
/public/static/xadmin/*
\ No newline at end of file
...@@ -6,10 +6,8 @@ ...@@ -6,10 +6,8 @@
namespace app\em\controller; namespace app\em\controller;
use app\admin\controller\Base; use app\admin\controller\Base;
use app\em\model\EmInvoice; use app\em\model\EmInvoice;
use app\em\model\EmInvoiceHistory;
use app\em\model\EmInvoiceUseage; use app\em\model\EmInvoiceUseage;
use app\em\model\EmPayment; use app\em\model\EmPayment;
use app\em\model\EmPaymentHistory;
use app\em\model\EmPaymentInvoice; use app\em\model\EmPaymentInvoice;
use app\em\model\EmPaymentInvoiceBalance; use app\em\model\EmPaymentInvoiceBalance;
use app\em\model\EmSettle; use app\em\model\EmSettle;
......
...@@ -41,16 +41,13 @@ class EmInvoice extends Base ...@@ -41,16 +41,13 @@ class EmInvoice extends Base
->select() ->select()
->toarray(); ->toarray();
foreach ($data as &$item){ foreach ($data as &$item){
if($item['payment_balance'] == '') $item['payment_balance'] = 0; if($item['payment_balance'] == 0){
if($item['settle_balance'] == '') $item['settle_balance'] = 0; $item['paid_amount'] = 0 ;
if($item['payment_balance']){
$item['paid_amount'] = $item['payment_amount'] ;
} else { } else {
$item['paid_amount'] = $item['payment_amount'] - $item['payment_balance']; $item['paid_amount'] = $item['payment_amount'] - $item['payment_balance'];
} }
if($item['settle_balance']){ if($item['settle_balance'] == 0){
$item['sett_amount'] = $item['settle_amount'] ; $item['sett_amount'] = 0 ;
} else { } else {
$item['sett_amount'] = $item['settle_amount'] - $item['settle_balance']; $item['sett_amount'] = $item['settle_amount'] - $item['settle_balance'];
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论