简要描述:

-获取分类列表

请求URL:

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

请求参数说明:

参数名 类型 是否必需 说明
page int 页码

返回示例:

正确时返回:

{
	"result": 1,
	"msg": "ok",
	"data": {
		"list": {
			"current_page": 1,
			"data": [
				{
					"id": 1,
					"name": "1",
					"parent_id": 0,
					"enabled": 1,
					"is_home": 1,
					"url": "http://yzmall.com/addons/yun_shop/?menu#/catelist/1?i=1",
					"procedures_url": "/packageB/member/category/catelist/catelist?id=1",
					"has_many_children": [
						{
							"id": 2,
							"name": "2",
							"parent_id": 1,
							"enabled": 1,
							"is_home": 1,
							"url": "http://yzmall.com/addons/yun_shop/?menu#/catelist/2?i=1",
							"procedures_url": "/packageB/member/category/catelist/catelist?id=2",
							"has_many_children": []
						},
						{
							"id": 17,
							"name": "1的分类3",
							"parent_id": 1,
							"enabled": 0,
							"is_home": 0,
							"url": "http://yzmall.com/addons/yun_shop/?menu#/catelist/17?i=1",
							"procedures_url": "/packageB/member/category/catelist/catelist?id=17",
							"has_many_children": [
								{
									"id": 23,
									"name": "123213",
									"parent_id": 17,
									"enabled": 1,
									"is_home": 1,
									"url": "http://yzmall.com/addons/yun_shop/?menu#/catelist/23?i=1",
									"procedures_url": "/packageB/member/category/catelist/catelist?id=23"
								}
							]
						},
						{
							"id": 22,
							"name": "125423523435",
							"parent_id": 1,
							"enabled": 0,
							"is_home": 0,
							"url": "http://yzmall.com/addons/yun_shop/?menu#/catelist/22?i=1",
							"procedures_url": "/packageB/member/category/catelist/catelist?id=22",
							"has_many_children": []
						}
					]
				},
				{
					"id": 24,
					"name": "家用电器",
					"parent_id": 0,
					"enabled": 1,
					"is_home": 0,
					"url": "http://yzmall.com/addons/yun_shop/?menu#/catelist/24?i=1",
					"procedures_url": "/packageB/member/category/catelist/catelist?id=24",
					"has_many_children": [
						{
							"id": 25,
							"name": "生活电器",
							"parent_id": 24,
							"enabled": 1,
							"is_home": 0,
							"url": "http://yzmall.com/addons/yun_shop/?menu#/catelist/25?i=1",
							"procedures_url": "/packageB/member/category/catelist/catelist?id=25",
							"has_many_children": [
								{
									"id": 26,
									"name": "空气净化器",
									"parent_id": 25,
									"enabled": 1,
									"is_home": 0,
									"url": "http://yzmall.com/addons/yun_shop/?menu#/catelist/26?i=1",
									"procedures_url": "/packageB/member/category/catelist/catelist?id=26"
								},
								{
									"id": 27,
									"name": "净水器",
									"parent_id": 25,
									"enabled": 1,
									"is_home": 0,
									"url": "http://yzmall.com/addons/yun_shop/?menu#/catelist/27?i=1",
									"procedures_url": "/packageB/member/category/catelist/catelist?id=27"
								},
								{
									"id": 50,
									"name": "吸尘器",
									"parent_id": 25,
									"enabled": 1,
									"is_home": 0,
									"url": "http://yzmall.com/addons/yun_shop/?menu#/catelist/50?i=1",
									"procedures_url": "/packageB/member/category/catelist/catelist?id=50"
								}
							]
						},
						{
							"id": 28,
							"name": "厨房小电",
							"parent_id": 24,
							"enabled": 1,
							"is_home": 0,
							"url": "http://yzmall.com/addons/yun_shop/?menu#/catelist/28?i=1",
							"procedures_url": "/packageB/member/category/catelist/catelist?id=28",
							"has_many_children": [
								{
									"id": 29,
									"name": "果蔬解毒机",
									"parent_id": 28,
									"enabled": 1,
									"is_home": 0,
									"url": "http://yzmall.com/addons/yun_shop/?menu#/catelist/29?i=1",
									"procedures_url": "/packageB/member/category/catelist/catelist?id=29"
								}
							]
						}
					]
				}
			],
			"first_page_url": "http://yzmall.com/addons/yun_shop/api.php?page=1",
			"from": 1,
			"last_page": 4,
			"last_page_url": "http://yzmall.com/addons/yun_shop/api.php?page=4",
			"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": 7
		},
		"setLevel": "3"
	}
}

返回参数说明:

参数名 类型 说明
setLevel int 开启的分类等级,2二级分类,3三级分类
list array 分类数据

list参数说明:分类数据

参数名 类型 说明
id int 分类ID
name string 分类名
parent_id int 上级ID
enabled int 是否显示:0否1是
is_home int 是否推荐:0否1是
has_many_children array 下级分类数据(数据字段一致,如果开启3级分类,那么里边还有一层has_many_children)

错误时返回:

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