|
|
|
@ -20,10 +20,16 @@ class GoodsNew extends Controller |
|
|
|
|
$keyword = $this->request->param('keyword'); |
|
|
|
|
$page = $this->request->param('page', 1); |
|
|
|
|
$limit = $this->request->param('limit', 10); |
|
|
|
|
if (!$keyword) { |
|
|
|
|
$this->renderError('请输入搜索关键字'); |
|
|
|
|
} |
|
|
|
|
$params = ['goods_name' => $keyword]; |
|
|
|
|
$goodsService = new GoodsEs(); |
|
|
|
|
$data = $goodsService->list($params, $page, $limit); |
|
|
|
|
$this->renderSuccess($data); |
|
|
|
|
$data['total'] = $goodsService->count(); |
|
|
|
|
$data['list'] = $data; |
|
|
|
|
|
|
|
|
|
return $this->renderSuccess($data); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|