From 2ddd560df769641fe8e6dd7cf34f9275c85ac56d Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Wed, 16 Oct 2024 14:39:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=B3=BB=E7=BB=9F=E5=95=86?= =?UTF-8?q?=E5=BA=97=E5=88=97=E8=A1=A8=E5=88=86=E9=A1=B5=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 调整 SystemStoreLists 类中的查询逻辑,用 $this->limitOffset 和 $this->limitLength 替代固定的限制数量,实现可配置的分页大小和偏移量。 --- app/api/lists/store/SystemStoreLists.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/api/lists/store/SystemStoreLists.php b/app/api/lists/store/SystemStoreLists.php index 8d7c4b0eb..a45511f34 100644 --- a/app/api/lists/store/SystemStoreLists.php +++ b/app/api/lists/store/SystemStoreLists.php @@ -51,6 +51,7 @@ class SystemStoreLists extends BaseAdminDataLists implements ListsSearchInterfac $latitude = $this->request->get('latitude', ''); $longitude = $this->request->get('longitude', ''); $cart_id = $this->request->get('cart_id', ''); + $where[] = ['is_show', '=', YesNoEnum::YES]; $data = SystemStore::where($this->searchWhere)->where($where) ->field([ @@ -70,7 +71,7 @@ class SystemStoreLists extends BaseAdminDataLists implements ListsSearchInterfac 'is_send', 'abbreviation' ]) - ->limit(100) + ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) ->select() ->toArray();