简要描述:
- 商品搜索接口
请求URL:
GET/app/index.php?i=2&c=entry&do=shop&m=yun_shop&route=goods.goods.search-goods&search[keyword]=s
参数:
参数名 | 是否必须 | 类型 | 说明 |
---|---|---|---|
search[keyword] | 否 | string | 关键字 |
search[brand_id] | 否 | int | 品牌id |
search[product_attr] | 否 | string | 是否热卖/促销等,值为is_hot/is_new/is_recommand/is_comment 限时购值为limit_buy |
search[min_price] | 否 | int | 最低价 |
search[max_price] | 否 | int | 最高价 |
search[category] | 否 | int | 分类id |
order_field | 否 | int | 排序字段(price, show_sales, comment_num) |
order_by | 否 | int | 升降序(desc, asc) |
search[filtering] | 否 | int | 筛选id |
search[as_id] | 否 | int | 分站id |
返回示例:
正确时返回:
{
"result": 1,
"msg": "成功",
"data": {
"total": 3,
"per_page": 20,
"current_page": 1,
"last_page": 1,
"next_page_url": null,
"prev_page_url": null,
"from": 1,
"to": 3,
"data": [
{
"id": 62,
"uniacid": 6,
"brand_id": 0,
"type": 1,
"status": 1,
"display_order": 2,
"title": "s是是是",
"thumb": "http://n1.cn/attachment/images/6/2017/03/w1leEV09AFbG2Yz9l9vXBycyELL7F2.jpg",
"thumb_url": null,
"sku": "个",
"description": "",
"content": null,
"goods_sn": "",
"product_sn": "",
"market_price": "555.00",
"price": "22.00",
"cost_price": "44.00",
"stock": 22,
"reduce_stock_method": 0,
"show_sales": 0,
"real_sales": 0,
"weight": "0.00",
"has_option": 1,
"is_new": 1,
"is_hot": 0,
"is_discount": 0,
"is_recommand": 0,
"is_comment": 0,
"is_deleted": 0,
"created_at": "2017-03-25 11:50:12",
"deleted_at": null,
"updated_at": "2017-03-25 12:58:23",
"coupon" : [
"deduct_price" : "12",
"coupon_method" : "1",
"discount" : "1.0",
"deduct" : "12",
]
},
{
"id": 4,
"uniacid": 6,
"brand_id": 0,
"type": 1,
"status": 1,
"display_order": 0,
"title": "sfdfsdfsdf323",
"thumb": "",
"thumb_url": null,
"sku": "",
"description": "",
"content": null,
"goods_sn": "",
"product_sn": "",
"market_price": "0.00",
"price": "0.00",
"cost_price": "0.00",
"stock": 0,
"reduce_stock_method": 0,
"show_sales": 0,
"real_sales": 0,
"weight": "0.00",
"has_option": 0,
"is_new": 0,
"is_hot": 0,
"is_discount": 0,
"is_recommand": 0,
"is_comment": 0,
"is_deleted": 0,
"created_at": "2038-01-19 11:14:07",
"deleted_at": null,
"updated_at": "2038-01-19 11:14:07",
"coupon" : [
"coupon_method" : "0",
]
},
{
"id": 2,
"uniacid": 6,
"brand_id": 0,
"type": 1,
"status": 1,
"display_order": 0,
"title": "sdfsdfsdfvvvvv",
"thumb": "http://n1.cn/attachment/images/6/2017/03/SIHMoubZvIqPnRjGgGNBHJgVN2XJDV.jpg",
"thumb_url": "a:2:{i:0;s:75:\"http://n1.cn/attachment/images/6/2017/03/SIHMoubZvIqPnRjGgGNBHJgVN2XJDV.jpg\";i:1;s:75:\"http://n1.cn/attachment/images/6/2017/03/w1leEV09AFbG2Yz9l9vXBycyELL7F2.jpg\";}",
"sku": "个",
"description": "",
"content": null,
"goods_sn": "",
"product_sn": "234234234",
"market_price": "32.00",
"price": "12.00",
"cost_price": "444.00",
"stock": 222,
"reduce_stock_method": 0,
"show_sales": 0,
"real_sales": 0,
"weight": "0.00",
"has_option": 1,
"is_new": 1,
"is_hot": 0,
"is_discount": 0,
"is_recommand": 0,
"is_comment": 0,
"is_deleted": 0,
"created_at": "2038-01-19 11:14:07",
"deleted_at": null,
"updated_at": "2017-03-25 11:42:32",
"coupon" : [
"deduct_price" : "12",
"coupon_method" : "2",
"discount" : "1",
]
}
]
}
}
错误时返回:
{
result: 0,
msg: "商品不存在.",
data: [ ]
}
返回参数说明:
参数名 | 类型 | 说明 |
---|---|---|
id | int | 商品ID |
uniacid | int | 店铺ID |
brand_id | int | 品牌ID |
type | int | 商品类型: 1为实体,2为虚拟 |
status | int | 商品状态: 1上架,0下架 |
title | string | 商品标题 |
thumb | string | 商品图片完整路径 |
thumb_url | array | 其它商品图片完整路径 |
sku | string | 商品单位(个、台、件等) |
description | string | 商品描述 |
content | string | 商品详情 |
goods_sn | string | 商品编号 |
product_sn | string | 商品条码 |
market_price | float | 商品市场价(元) |
price | float | 商品金额(元) |
stock | int | 库存 |
show_sales | int | 销量 |
weight | float | 重量 |
has_option | int | 是否有规格 1是 0否 |
is_new | int | 是否新上 |
is_hot | int | 是否热卖 |
is_discount | int | 是否促销 |
is_recommand | int | 是否推荐 |
is_comment | int | 是否允许评论 |
coupon['deduct_price'] | int | 商品折扣后的价格 |
coupon['coupon_method'] | int | 折扣方式(1立减,2打折,0无折扣) |
coupon['discount'] | int | 打几折,当coupon_method为2是才有效 |
coupon['deduct'] | int | 立减多少元,当coupon_method为1是才有效 |
备注:
- 更多返回错误代码请看首页的错误代码描述