From dccfdfbe5e660317dd5014447af329535bf0db5f Mon Sep 17 00:00:00 2001 From: evoxwht <442384644@qq.com> Date: Fri, 24 Mar 2023 15:16:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E7=A5=A8=E5=90=8E=E5=8F=B0=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E4=BB=A5=E5=8F=8A=E7=BC=96=E8=BE=91=E6=97=B6=E5=80=99?= =?UTF-8?q?=E7=9A=84=E5=AD=97=E6=AE=B5=E4=B8=8D=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/v1/order/StoreOrderInvoice.php | 2 ++ .../order/StoreOrderInvoiceServices.php | 17 ++++++++++++----- .../admin/src/pages/order/invoice/index.vue | 5 +++-- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/crmeb/app/adminapi/controller/v1/order/StoreOrderInvoice.php b/crmeb/app/adminapi/controller/v1/order/StoreOrderInvoice.php index 885ca417f..8a7b07b4f 100644 --- a/crmeb/app/adminapi/controller/v1/order/StoreOrderInvoice.php +++ b/crmeb/app/adminapi/controller/v1/order/StoreOrderInvoice.php @@ -45,6 +45,8 @@ class StoreOrderInvoice extends AuthController { $where = $this->request->getMore([ ['data', '', '', 'time'], + ['real_name', ''], + ['field_key', ''], [['type', 'd'], 0], ]); $data = $this->services->chart($where); diff --git a/crmeb/app/services/order/StoreOrderInvoiceServices.php b/crmeb/app/services/order/StoreOrderInvoiceServices.php index 3e76fc10a..475c6606d 100644 --- a/crmeb/app/services/order/StoreOrderInvoiceServices.php +++ b/crmeb/app/services/order/StoreOrderInvoiceServices.php @@ -36,21 +36,28 @@ class StoreOrderInvoiceServices extends BaseServices public function chart(array $where) { + $where['is_pay'] = 1; //全部 - $data['all'] = (string)$this->dao->count(['is_pay' => 1, 'time' => $where['time']]); + $data['all'] = (string)$this->dao->count($where); //待开 - $data['noOpened'] = (string)$this->dao->count(['is_pay' => 1, 'time' => $where['time'], 'type' => 1]); + $where['type'] = 1; + $data['noOpened'] = (string)$this->dao->count($where); //已开 - $data['opened'] = (string)$this->dao->count(['is_pay' => 1, 'time' => $where['time'], 'type' => 2]); + $where['type'] = 2; + $data['opened'] = (string)$this->dao->count($where); //退款 - $data['refund'] = (string)$this->dao->count(['is_pay' => 1, 'time' => $where['time'], 'type' => 3]); + $where['type'] = 3; + $data['refund'] = (string)$this->dao->count($where); return $data; } /** * 后台获取开票列表 - * @param $where + * @param array $where * @return array + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException */ public function getList(array $where) { diff --git a/template/admin/src/pages/order/invoice/index.vue b/template/admin/src/pages/order/invoice/index.vue index 85e490bee..e322afdab 100644 --- a/template/admin/src/pages/order/invoice/index.vue +++ b/template/admin/src/pages/order/invoice/index.vue @@ -151,7 +151,7 @@