简要描述:

-获取商品列表

请求URL:

&route=plugin.shop-assistant.frontend.goods.get-list

请求参数说明:

参数名 类型 是否必需 说明
page int 页码
search[status] int 状态:0下架,1上架,不传全部
search[title] string 搜索内容

返回示例:

正确时返回:

{
	"result": 1,
	"msg": "ok",
	"data": {
		"current_page": 1,
		"data": [
			{
				"id": 178,
				"title": "课程1商品测试",
				"thumb": "images/1/2019/10/D4uZa999psputsapuDASza5WAWfs9p.jpg",
				"status": 1,
				"market_price": "10.00",
				"price": "100.00",
				"cost_price": "10.00",
				"stock": 96,
				"show_sales": 4,
				"real_sales": 4,
				"virtual_sales": 1,
				"thumb_src": "http://shop-yunzshop-com.oss-cn-hangzhou.aliyuncs.com/images/1/2019/10/D4uZa999psputsapuDASza5WAWfs9p.jpg"
			},
			{
				"id": 175,
				"title": "12",
				"thumb": "123",
				"status": 0,
				"market_price": "0.00",
				"price": "0.00",
				"cost_price": "0.00",
				"stock": 0,
				"show_sales": 0,
				"real_sales": 0,
				"virtual_sales": 0,
				"thumb_src": "http://shop-yunzshop-com.oss-cn-hangzhou.aliyuncs.com/123"
			}
		],
		"first_page_url": "http://yzmall.com/addons/yun_shop/api.php?page=1",
		"from": 1,
		"last_page": 20,
		"last_page_url": "http://yzmall.com/addons/yun_shop/api.php?page=20",
		"next_page_url": "http://yzmall.com/addons/yun_shop/api.php?page=2",
		"path": "http://yzmall.com/addons/yun_shop/api.php",
		"per_page": 2,
		"prev_page_url": null,
		"to": 2,
		"total": 40
	}
}

返回参数说明:

参数名 类型 说明
id int 商品ID
title string 商品名
thumb string 商品图片(thumb_src绝对地址)
status int 状态:0下架1商家
market_price float 原价
price float 现价
cost_price float 成本价
stock int 库存
show_sales int 已出售数量
real_sales int 实际出售数量
virtual_sales int 虚拟销量

错误时返回:

{
    "result": 0,
    "msg": "请登录",
    "data": []
}