|
|
|
@ -6,6 +6,7 @@ namespace App\Service\v3\Implementations; |
|
|
|
|
|
|
|
use App\Model\v3\Goods; |
|
|
|
use App\Model\v3\Store; |
|
|
|
use Hyperf\Paginator\Paginator; |
|
|
|
|
|
|
|
class SearchService implements \App\Service\v3\Interfaces\SearchServiceInterface |
|
|
|
{ |
|
|
|
@ -44,7 +45,9 @@ class SearchService implements \App\Service\v3\Interfaces\SearchServiceInterface |
|
|
|
} |
|
|
|
|
|
|
|
$builder->select(['id', 'store_id', 'cover_img', 'name', 'spec', 'tags', 'original_price', 'price', 'inventory', 'sales as total_sales']); |
|
|
|
return $goods = $builder->forPage($params['page'], $params['pagesize'])->get()->toArray(); |
|
|
|
$paginate = $builder->paginate($params['pagesize']); |
|
|
|
$goods = $paginate->toArray(); |
|
|
|
return ['has_more_pages' => $paginate->hasMorePages(), 'goods' => $goods]; |
|
|
|
} |
|
|
|
|
|
|
|
public function doForStores($params) |
|
|
|
@ -81,8 +84,9 @@ class SearchService implements \App\Service\v3\Interfaces\SearchServiceInterface |
|
|
|
} |
|
|
|
|
|
|
|
$builder->select(['id', 'logo', 'name']); |
|
|
|
$stores = $builder->forPage($params['page'], $params['pagesize'])->get()->toArray(); |
|
|
|
return $stores; |
|
|
|
$paginate = $builder->paginate($params['pagesize']); |
|
|
|
$stores = $paginate->toArray(); |
|
|
|
return ['has_more_pages' => $paginate->hasMorePages(), 'stores' => $stores]; |
|
|
|
} |
|
|
|
|
|
|
|
public function getHotKeywords($type) |
|
|
|
|