diff --git a/application/admin/controller/Invoice.php b/application/admin/controller/Invoice.php index 60aeb7e9..e522a41d 100644 --- a/application/admin/controller/Invoice.php +++ b/application/admin/controller/Invoice.php @@ -20,10 +20,10 @@ class Invoice extends AdminBase // 构建查询条件 $where = []; if (!empty($get['keyword'])) { - $where[] = ['i.oid|i.invoice_id', 'like', '%' . $get['keyword'] . '%']; + $where[] = ['oid|invoice_id', 'like', '%' . $get['keyword'] . '%']; } if (isset($get['state']) && $get['state'] !== '') { - $where[] = ['i.state', '=', intval($get['state'])]; + $where[] = ['state', '=', intval($get['state'])]; } // 查询数据(关联订单表获取订单编号) diff --git a/application/api/controller/Invoice.php b/application/api/controller/Invoice.php index ea466083..7342018f 100644 --- a/application/api/controller/Invoice.php +++ b/application/api/controller/Invoice.php @@ -102,6 +102,7 @@ class Invoice extends ApiBase ])->where('uid', $uid)->paginate(10); $data = []; if ($list != null){ + $currentDomain = $_SERVER['HTTP_HOST']; foreach ($list as $value){ $data[] = [ 'id' => $value['id'], @@ -111,6 +112,7 @@ class Invoice extends ApiBase 'invoice_title' => $value['invoice']['invoice_title'], 'order_sn' => $value['order']['order_sn'] ?? '', 'order_money' => $value['order']['settle_amount'] ?? 0, + 'document' => "https://".$currentDomain."/public/".$value['document'] ?? '', ]; } }