提交 14ae20b0 authored 作者: chengye's avatar chengye

修复账单如果没有附件则现实错误页面的问题

上级 5b6f39b2
......@@ -117,11 +117,13 @@ class EmInvoice extends Base
$eiu = EmInvoiceUseage::where(['invoice_id'=>$inv->invoice_id])->find();
//查询抄表信息
$useage = Useage::with('photo')->get(['useage_id'=>$eiu->useage_id]);
if(isset($useage->photo_id) && is_int($useage->photo_id) && $useage->photo_id != 0) {
$receipt = Receipt::get(['id'=>$useage->photo_id ?: 0]);
if($receipt) $useage['photo'] = $receipt;
$uModel = Useage::get(['useage_id'=>$eiu->useage_id]);
if($uModel->cert_id != ''){
$useage = Useage::with('photo')->get(['useage_id'=>$eiu->useage_id]);
if($useage->photo_id) {
$receipt = Receipt::get(['id'=>$useage->photo_id]);
if($receipt) $useage['photo'] = $receipt;
}
} else {
$useage['photo'] = [];
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论