|
|
|
@ -5,6 +5,7 @@ namespace App\Controller\v3; |
|
|
|
use App\Controller\BaseController; |
|
|
|
use App\Request\v3\SearchGoodsRequest; |
|
|
|
use App\Request\v3\SearchStoreRequest; |
|
|
|
use App\Service\v3\Interfaces\LocationServiceInterface; |
|
|
|
use App\Service\v3\Interfaces\SearchServiceInterface; |
|
|
|
use Hyperf\Di\Annotation\Inject; |
|
|
|
use Psr\Http\Message\ResponseInterface; |
|
|
|
@ -17,6 +18,12 @@ class SearchController extends BaseController |
|
|
|
*/ |
|
|
|
protected $searchService; |
|
|
|
|
|
|
|
/** |
|
|
|
* @Inject |
|
|
|
* @var LocationServiceInterface |
|
|
|
*/ |
|
|
|
protected $locationService; |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取搜索热词 |
|
|
|
* 1、参数type区分是商品还是商户 |
|
|
|
@ -62,4 +69,16 @@ class SearchController extends BaseController |
|
|
|
|
|
|
|
return $this->success(['stores' => $data]); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 市场搜索 |
|
|
|
* |
|
|
|
*/ |
|
|
|
public function market() |
|
|
|
{ |
|
|
|
$keywords = $this->request->input('keywords',''); |
|
|
|
$cityId = $this->request->input('city_id',2163); |
|
|
|
$data = $this->locationService->searchMarket($keywords,$cityId); |
|
|
|
return $this->success(['markets' => $data]); |
|
|
|
} |
|
|
|
} |