简要描述:

搜索商品分类

请求域名:

  • http://xx.com

请求URL:

plugin.store-decorate.admin.decorate-common.search-category

参数:

参数名 是否必须 类型 说明
page int 分页 (每页固定10条)
store_id int 门店ID

返回示例:

正确时返回:

{
    "result": 1,
    "msg": "成功",
    "data": {
        "total": 2,
        "per_page": 10,
        "current_page": 1,
        "last_page": 1,
        "next_page_url": null,
        "prev_page_url": null,
        "from": 1,
        "to": 2,
        "data": [
            {
                "id": 1,
                "name": "1",
                "parent_id": 0,
                "url": "http://www.yzdev8.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,
                        "url": "http://www.yzdev8.com/addons/yun_shop/?menu#/catelist/2?i=1",
                        "procedures_url": "/packageB/member/category/catelist/catelist?id=2",
                        "has_many_children": [
                            {
                                "id": 35,
                                "name": "冲钱那个少年",
                                "parent_id": 2,
                                "url": "http://www.yzdev8.com/addons/yun_shop/?menu#/catelist/35?i=1",
                                "procedures_url": "/packageB/member/category/catelist/catelist?id=35"
                            }
                        ]
                    },
                    {
                        "id": 17,
                        "name": "1的分类3",
                        "parent_id": 1,
                        "url": "http://www.yzdev8.com/addons/yun_shop/?menu#/catelist/17?i=1",
                        "procedures_url": "/packageB/member/category/catelist/catelist?id=17",
                        "has_many_children": []
                    }
                ]
            },
            {
                "id": 36,
                "name": "商品一级分类",
                "parent_id": 0,
                "url": "http://www.yzdev8.com/addons/yun_shop/?menu#/catelist/36?i=1",
                "procedures_url": "/packageB/member/category/catelist/catelist?id=36",
                "has_many_children": [
                    {
                        "id": 37,
                        "name": "商品二级分类",
                        "parent_id": 36,
                        "url": "http://www.yzdev8.com/addons/yun_shop/?menu#/catelist/37?i=1",
                        "procedures_url": "/packageB/member/category/catelist/catelist?id=37",
                        "has_many_children": [
                            {
                                "id": 38,
                                "name": "商品三级分类",
                                "parent_id": 37,
                                "url": "http://www.yzdev8.com/addons/yun_shop/?menu#/catelist/38?i=1",
                                "procedures_url": "/packageB/member/category/catelist/catelist?id=38"
                            }
                        ]
                    }
                ]
            }
        ]
    }
}

错误时返回:

{
    "result": 0,
    "msg": "暂无数据",
    "data": []
}

返回参数说明:

参数名 类型 说明
data[total] int 数据总条数
data[per_page] int 每页显示多少条数据
data[current_page] int 当前页
data[data][has_many_children] array 下一级分类数组
data[data][id] int 分类id
data[data][name] string 分类名称
data[data][parent_id] int 分类上级id,对应id(0为一级分类)

备注:

商品分类目前最高为3级分类

  • 更多返回错误代码请看首页的错误代码描述