From 264ff0565f6bef5eb45525d2527cddfa6b63aa3f Mon Sep 17 00:00:00 2001 From: Lemon <15040771@qq.com> Date: Fri, 23 Oct 2020 16:46:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=90=9C=E7=B4=A2=E6=8E=A5=E5=8F=A3=20and=20?= =?UTF-8?q?=E9=A6=96=E9=A1=B5=E5=BA=97=E9=93=BA=E5=88=97=E8=A1=A8=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=20=E4=BC=91=E6=81=AF=E7=9A=84=E5=BA=97=E9=93=BA?= =?UTF-8?q?=E4=B9=9F=E8=83=BD=E6=9F=A5=E5=87=BA=E6=9D=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Service/v3/Implementations/SearchService.php | 5 +++-- app/Service/v3/Implementations/StoreService.php | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/Service/v3/Implementations/SearchService.php b/app/Service/v3/Implementations/SearchService.php index 4768e71..a188446 100644 --- a/app/Service/v3/Implementations/SearchService.php +++ b/app/Service/v3/Implementations/SearchService.php @@ -110,12 +110,13 @@ class SearchService implements SearchServiceInterface $query->where(''.$goodsTable.'.inventory', '>', 0)->orWhere(''.$goodsTable.'.is_infinite', '=', 1); }) ->whereRaw(''.$goodsTable.'.deleted_at IS NULL') - ->where([''.$storeTable.'.market_id' => $params['market_id'], ''.$storeTable.'.is_rest' => StoreConstants::IS_REST_NO]) + ->where([''.$storeTable.'.market_id' => $params['market_id']]) + ->orderBy($storeTable.'.is_rest','asc'); /*->where('time1', '<=', date('H:i')) ->where(function ($query) { $query->where('time2', '>=', date('H:i')) ->orWhere('time4', '>=', date('H:i')); - })*/; + })*/ if (isset($params['store_id']) && $params['store_id']) { $builder->where([''.$storeTable.'.store_id' => $params['store_id']]); diff --git a/app/Service/v3/Implementations/StoreService.php b/app/Service/v3/Implementations/StoreService.php index 50cb0fc..2ef73e4 100644 --- a/app/Service/v3/Implementations/StoreService.php +++ b/app/Service/v3/Implementations/StoreService.php @@ -82,7 +82,8 @@ class StoreService implements StoreServiceInterface $query->where(''.$goodsTable.'.inventory', '>', 0)->orWhere(''.$goodsTable.'.is_infinite', '=', 1); }) ->whereRaw(''.$goodsTable.'.deleted_at IS NULL') - ->where([''.$storeTable.'.market_id' => $marketId, ''.$storeTable.'.is_rest' => StoreConstants::IS_REST_NO]); + ->where([''.$storeTable.'.market_id' => $marketId]) + ->orderBy($storeTable.'.is_rest','asc');; $paginate = $builder->groupBy(''.$storeTable.'.id')->orderByDesc($storeTable.'.sales')->paginate($pagesize); $stores = $paginate->map(function ($item, $key) {