From cfeb53e4f09c58d33436813692d87c44b36270f4 Mon Sep 17 00:00:00 2001 From: liu <1873441552@qq.com> Date: Sat, 1 Jun 2024 14:56:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E9=97=A8=E5=BA=97?= =?UTF-8?q?=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/store/StoreController.php | 17 +++++ app/api/lists/store/SystemStoreLists.php | 71 ++++++++++++++++++++ 2 files changed, 88 insertions(+) create mode 100644 app/api/controller/store/StoreController.php create mode 100644 app/api/lists/store/SystemStoreLists.php diff --git a/app/api/controller/store/StoreController.php b/app/api/controller/store/StoreController.php new file mode 100644 index 000000000..4d378a6cd --- /dev/null +++ b/app/api/controller/store/StoreController.php @@ -0,0 +1,17 @@ +dataLists(new SystemStoreLists()); + } + + +} \ No newline at end of file diff --git a/app/api/lists/store/SystemStoreLists.php b/app/api/lists/store/SystemStoreLists.php new file mode 100644 index 000000000..672c7f404 --- /dev/null +++ b/app/api/lists/store/SystemStoreLists.php @@ -0,0 +1,71 @@ + ['phone'], + '%like%' => ['name'], + ]; + } + + + /** + * @notes 获取门店列表列表 + * @return array + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + * @author admin + * @date 2024/05/31 17:45 + */ + public function lists(): array + { + $where[]=['is_show','=',YesNoEnum::YES]; + return SystemStore::where($this->searchWhere)->where($where) + ->field(['id', 'name', 'phone', 'detailed_address', 'image', 'is_show', + 'day_time','is_store','latitude','longitude' + ]) + ->limit($this->limitOffset, $this->limitLength) + ->order(['id' => 'desc']) + ->select() + ->toArray(); + } + + + /** + * @notes 获取门店列表数量 + * @return int + * @author admin + * @date 2024/05/31 17:45 + */ + public function count(): int + { + $where[]=['is_show','=',YesNoEnum::YES]; + return SystemStore::where($this->searchWhere)->where($where)->count(); + } + +} \ No newline at end of file