From 2a4c2169e18a9dcd7e749958f2b345c5be6da16c Mon Sep 17 00:00:00 2001 From: ztt <835303992@qq.com> Date: Fri, 31 May 2024 13:37:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=81=E8=A3=85Es=E5=95=86=E5=93=81=E6=90=9C?= =?UTF-8?q?=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/GoodsNew.php | 2 +- app/common/library/elasticsearch/Client.php | 24 ++++++++++----------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/app/api/controller/GoodsNew.php b/app/api/controller/GoodsNew.php index 8b288617..aac7c3ea 100644 --- a/app/api/controller/GoodsNew.php +++ b/app/api/controller/GoodsNew.php @@ -27,7 +27,7 @@ class GoodsNew extends Controller $goodsService = new GoodsEs(); $list = $goodsService->list($params, $page, $limit); $data['list'] = $list; - $data['total'] = $goodsService->count(); + $data['total'] = $goodsService->count($params); return $this->renderSuccess($data); } diff --git a/app/common/library/elasticsearch/Client.php b/app/common/library/elasticsearch/Client.php index 769e03a6..9af6eb96 100644 --- a/app/common/library/elasticsearch/Client.php +++ b/app/common/library/elasticsearch/Client.php @@ -233,8 +233,8 @@ class Client ];*/ $must[] = [ -// 'match' => [$filed => $value] - 'match_phrase' => [$filed => $value] + 'match' => [$filed => $value] +// 'match_phrase' => [$filed => $value] ]; } } @@ -281,7 +281,7 @@ class Client public function query($isTotal = false) { -// try { + try { $this->parseQueryParams(); // dd($this->queryParams); @@ -333,15 +333,15 @@ class Client } -// } catch (\Exception $e) { -// -// $msg = $e->getMessage(); -// -// $msg = '服务器开小差了~'; -// -// throw new Exception($msg); -// -// } + } catch (\Exception $e) { + + $msg = $e->getMessage(); + + $msg = '服务器开小差了~'; + + throw new Exception($msg); + + } } /**