|
|
|
@ -84,7 +84,7 @@ class StoreService implements StoreServiceInterface |
|
|
|
->whereRaw(''.$goodsTable.'.deleted_at IS NULL') |
|
|
|
->where([''.$storeTable.'.market_id' => $marketId, ''.$storeTable.'.is_rest' => StoreConstants::IS_REST_NO]); |
|
|
|
|
|
|
|
$paginate = $builder->groupBy(''.$storeTable.'.id')->orderBy($storeTable.'.is_rest','asc')->orderByDesc($storeTable.'.sales')->paginate($pagesize); |
|
|
|
$paginate = $builder->groupBy(''.$storeTable.'.id')->orderByDesc($storeTable.'.sales')->paginate($pagesize); |
|
|
|
$stores = $paginate->map(function ($item, $key) { |
|
|
|
$item->goods; |
|
|
|
return $item; |
|
|
|
|