From 49367b84dc8f09d6b816a8047a7953c12f379e2c Mon Sep 17 00:00:00 2001 From: gongfuxiang Date: Thu, 30 Jun 2022 16:50:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=90=9C=E7=B4=A2=E5=95=86=E5=93=81=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E6=95=B0=E9=87=8F=E4=B8=8D=E5=BE=97=E8=B6=85?= =?UTF-8?q?=E8=BF=87500?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/service/SearchService.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/service/SearchService.php b/app/service/SearchService.php index fc24804b2..98356ccf6 100755 --- a/app/service/SearchService.php +++ b/app/service/SearchService.php @@ -164,6 +164,11 @@ class SearchService $field = 'g.*'; $result['page'] = max(1, isset($params['page']) ? intval($params['page']) : 1); $result['page_size'] = empty($params['page_size']) ? MyC('home_search_limit_number', 20, true) : intval($params['page_size']); + // 数量不能超过500 + if($result['page_size'] > 500) + { + $result['page_size'] = 500; + } $result['page_start'] = intval(($result['page']-1)*$result['page_size']); // 搜索商品列表读取前钩子