From 71c430d6392c2fdb1022adc7f8d77e8185eeec0e Mon Sep 17 00:00:00 2001 From: wang hou sheng <76928547+wanghousheng@users.noreply.github.com> Date: Thu, 18 Apr 2024 01:19:36 +0800 Subject: [PATCH] 1 --- app/store/controller/user/Identity.php | 3 ++- app/store/controller/user/Invoice.php | 35 ++++++++++++++++++++++++++ app/store/model/user/UserInvoice.php | 27 ++++++++++++++++++++ 3 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 app/store/controller/user/Invoice.php create mode 100644 app/store/model/user/UserInvoice.php diff --git a/app/store/controller/user/Identity.php b/app/store/controller/user/Identity.php index 14b564d1..6b2c3791 100644 --- a/app/store/controller/user/Identity.php +++ b/app/store/controller/user/Identity.php @@ -1,9 +1,10 @@ request->post('type', 0)); + if ($type) { + $where['type'] = $type; + } + $source = intval($this->request->post('source', 0)); + if ($source) { + $where['source'] = $source; + } + $list = (new UserInvoice)->getList($where); + $data['list'] = $list->items(); + $data['total'] = $list->total(); + return $this->renderSuccess($data); + } +} \ No newline at end of file diff --git a/app/store/model/user/UserInvoice.php b/app/store/model/user/UserInvoice.php new file mode 100644 index 00000000..c406053c --- /dev/null +++ b/app/store/model/user/UserInvoice.php @@ -0,0 +1,27 @@ +with(['user.avatar']) + ->where($where) + ->order($this->getPk(), 'desc') + ->paginate($listRows); + } +} \ No newline at end of file