...
|
...
|
@@ -107,9 +107,9 @@ class Index extends Api |
|
|
*/
|
|
|
public function searchGoodsList()
|
|
|
{
|
|
|
$rows = $this->request->request('rows',null);// 每页条数
|
|
|
$page = $this->request->request('page',1);// 页码
|
|
|
$keywords = $this->request->request('keywords','');
|
|
|
$rows = $this->request->param('rows',null);// 每页条数
|
|
|
$page = $this->request->param('page',1);// 页码
|
|
|
$keywords = $this->request->param('keywords','');
|
|
|
$list = Goods::getList(['goods_name'=>['like','%'.$keywords.'%']],$page,$rows);
|
|
|
$this->success(__('成功'),compact('list'));
|
|
|
}
|
...
|
...
|
@@ -155,9 +155,9 @@ class Index extends Api |
|
|
*/
|
|
|
public function goodsList()
|
|
|
{
|
|
|
$rows = $this->request->request('rows',null);// 每页条数
|
|
|
$page = $this->request->request('page',1);// 页码
|
|
|
$category_id = $this->request->request('category_id');// 分类id
|
|
|
$rows = $this->request->param('rows',null);// 每页条数
|
|
|
$page = $this->request->param('page',1);// 页码
|
|
|
$category_id = $this->request->param('category_id');// 分类id
|
|
|
empty($category_id) && $this->error(__('参数不合法!'));
|
|
|
$three_category_id_arr = Category::where('pid',$category_id)->column('id');
|
|
|
$where = "FIND_IN_SET('{$category_id}', category_ids)";
|
...
|
...
|
@@ -185,8 +185,8 @@ class Index extends Api |
|
|
*/
|
|
|
public function memberGoodsList()
|
|
|
{
|
|
|
$rows = $this->request->request('rows',null);// 每页条数
|
|
|
$page = $this->request->request('page',1);// 页码
|
|
|
$rows = $this->request->param('rows',null);// 每页条数
|
|
|
$page = $this->request->param('page',1);// 页码
|
|
|
$list = Goods::getList(['ismember'=>'1'],$page,$rows);
|
|
|
// 返回结果
|
|
|
$this->success(__('成功'),compact('list'));
|
...
|
...
|
@@ -207,8 +207,8 @@ class Index extends Api |
|
|
*/
|
|
|
public function hotGoodsList()
|
|
|
{
|
|
|
$rows = $this->request->request('rows',null);// 每页条数
|
|
|
$page = $this->request->request('page',1);// 页码
|
|
|
$rows = $this->request->param('rows',null);// 每页条数
|
|
|
$page = $this->request->param('page',1);// 页码
|
|
|
$list = Goods::getList(['ishot'=>'1'],$page,$rows);
|
|
|
// 返回结果
|
|
|
$this->success(__('成功'),compact('list'));
|
...
|
...
|
@@ -229,7 +229,7 @@ class Index extends Api |
|
|
public function goodsInfo()
|
|
|
{
|
|
|
// 商品id
|
|
|
$goods_id = $this->request->request('goods_id');
|
|
|
$goods_id = $this->request->param('goods_id');
|
|
|
$goods = Goods::get($goods_id);
|
|
|
empty($goods) && $this->error(__('商品不存在'));
|
|
|
$goods['issale'] == '0' && $this->error(__('商品已下架'));
|
...
|
...
|
@@ -268,9 +268,9 @@ class Index extends Api |
|
|
public function appraiseList()
|
|
|
{
|
|
|
// 商品id
|
|
|
$rows = $this->request->request('rows',null);
|
|
|
$page = $this->request->request('page',1);
|
|
|
$goods_id = $this->request->request('goods_id');
|
|
|
$rows = $this->request->param('rows',null);
|
|
|
$page = $this->request->param('page',1);
|
|
|
$goods_id = $this->request->param('goods_id');
|
|
|
$list = \app\common\model\GoodsAppraise::getList(['goods_id'=>$goods_id],$page,$rows);
|
|
|
// 返回结果
|
|
|
$this->success(__('成功'),compact('list'));
|
...
|
...
|
@@ -290,7 +290,7 @@ class Index extends Api |
|
|
*/
|
|
|
public function styleList()
|
|
|
{
|
|
|
$goods_id = $this->request->request('goods_id');
|
|
|
$goods_id = $this->request->param('goods_id');
|
|
|
$goods = Goods::get($goods_id);
|
|
|
empty($goods) && $this->error(__('商品信息不存在'));
|
|
|
$goods_style = GoodsStyle::get(['goods_id'=>$goods_id]);
|
...
|
...
|
@@ -313,7 +313,7 @@ class Index extends Api |
|
|
*/
|
|
|
public function specData()
|
|
|
{
|
|
|
$goods_id = $this->request->request('goods_id');
|
|
|
$goods_id = $this->request->param('goods_id');
|
|
|
$goods = Goods::get($goods_id);
|
|
|
empty($goods) && $this->error(__('商品信息不存在'));
|
|
|
$spec_data = $goods['spec_type'] == '2' ? $goods->getManySpecData($goods['spec_rel'], $goods['spec']) : null;
|
...
|
...
|
@@ -335,8 +335,8 @@ class Index extends Api |
|
|
*/
|
|
|
public function getGoodsSku()
|
|
|
{
|
|
|
$goods_id = $this->request->request('goods_id');
|
|
|
$spec_sku_id = $this->request->request('spec_sku_id');
|
|
|
$goods_id = $this->request->param('goods_id');
|
|
|
$spec_sku_id = $this->request->param('spec_sku_id');
|
|
|
$goods = Goods::get($goods_id,['spec_rel.spec']);
|
|
|
empty($goods) && $this->error(__('商品信息不存在'));
|
|
|
empty($spec_sku_id) && $this->error(__('请选择规格'));
|
...
|
...
|
|