简要描述:
- 商品分类下商品列表接口
请求URL:
GET/app/index.php?i=6&c=entry&do=shop&m=yun_shop&route=goods.goods.get-goods-category-list&category_id=4
参数:
参数名 | 是否必须 | 类型 | 说明 |
---|---|---|---|
i | 是 | int | 店铺ID |
category_id | 是 | int | 分类ID |
order_field | 否 | int | 排序字段(price, show_sales, comment_num) |
order_by | 否 | int | 升降序(desc, asc) |
返回示例:
正确时返回:
{
"result": 1,
"msg": "成功",
"data": {
"name": "11111",
"thumb": "images/6/2017/03/w1leEV09AFbG2Yz9l9vXBycyELL7F2.jpg",
"id": 3,
"goods": {
"total": 2,
"per_page": 20,
"current_page": 1,
"last_page": 1,
"next_page_url": null,
"prev_page_url": null,
"from": 1,
"to": 2,
"data": [
{
"id": 2,
"title": "sdfsdfsdfvvvvv",
"thumb": "http://n1.cn/attachment/images/6/2017/03/SIHMoubZvIqPnRjGgGNBHJgVN2XJDV.jpg",
"price": "12.00",
"market_price": "32.00",
"": null
},
{
"id": 60,
"title": "11",
"thumb": "images/6/2017/03/w1leEV09AFbG2Yz9l9vXBycyELL7F2.jpg",
"price": "11.00",
"market_price": "22.00",
"": null
}
]
}
}
}
错误时返回:
{
result: 0,
msg: "此分类下没有商品.",
data: [ ]
}
{
result: 0,
msg: "请输入正确的商品分类.",
data: [ ]
}
返回参数说明:
参数名 | 类型 | 说明 |
---|---|---|
id | int | 商品ID |
title | string | 商品标题 |
thumb | string | 商品图片完整路径 |
price | float | 商品金额(元) |
market_price | float | 商品原价(市场价) |
备注:
- 更多返回错误代码请看首页的错误代码描述