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) {