简要描述:

  • 商品子分类接口 优化,增加商品返回 1.点击一级分类,加载二级分类和三级分类(如果开启三级分类),并且显示第一个二级分类的商品(如果开启三级分类,则显示第一个二级分类的第一个三级分类下的商品) 2.会员点击一个二级分类或三级分类,加载该分类下的商品 3.商品数据分页,获取下一页的商品数据需要请求goods.category.get-goods-list-by-category-id接口获取商品数据

请求域名:

  • http://yunzshop.com

请求URL:

POST/app/index.php?i=1&c=entry&do=shop&m=yun_shop&route=goods.category.get-children-category

参数:

参数名 是否必须 类型 说明
parent_id int 父类ID

返回示例:

正确时返回:

{
    "result":1,
    "msg":"获取子分类数据成功!",
    "data":{
        "total":1,
        "per_page":100,
        "current_page":1,
        "last_page":1,
        "next_page_url":null,
        "prev_page_url":null,
        "from":1,
        "to":1,
        "data":[
            {
                "id":147,
                "uniacid":10,
                "name":"2",
                "thumb":"https://dev-1251768088.cos.ap-guangzhou.myqcloud.com/images/10/2018/12/aA1155eye14UZ138FN1ZV1v1z33V3W.jpg",
                "parent_id":146,
                "description":"",
                "display_order":0,
                "enabled":1,
                "is_home":1,
                "adv_img":"",
                "adv_url":"",
                "level":2,
                "advimg_pc":"",
                "advurl_pc":"",
                "created_at":"2018-12-13 15:07:47",
                "updated_at":"2018-12-29 18:26:23",
                "deleted_at":null,
                "plugin_id":0,
                "filter_ids":null,
                "has_many_children":null
            }
        ],
        "goods_list":{
            "total":33,
            "per_page":20,
            "current_page":1,
            "last_page":2,
            "next_page_url":"https://dev7.yunzmall.com/addons/yun_shop/api.php?page=2",
            "prev_page_url":null,
            "from":1,
            "to":20,
            "data":[
                {
                    "id":653,
                    "uniacid":10,
                    "brand_id":0,
                    "type":1,
                    "status":1,
                    "display_order":0,
                    "title":"经销商提成",
                    "thumb":"https://dev-1251768088.cos.ap-guangzhou.myqcloud.com/images/10/2019/01/MST663zBsTfBZ9ttT939b99Uu9pft9.jpg",
                    "thumb_url":"a:1:{i:0;s:52:"images/10/2019/01/MST663zBsTfBZ9ttT939b99Uu9pft9.jpg";}",
                    "sku":"1",
                    "description":"",
                    "content":"",
                    "goods_sn":"",
                    "product_sn":"",
                    "market_price":"200.00",
                    "price":"100.00",
                    "cost_price":"10.00",
                    "stock":91,
                    "reduce_stock_method":0,
                    "show_sales":20,
                    "real_sales":20,
                    "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":"2019-05-24 17:10:17",
                    "deleted_at":null,
                    "updated_at":"2019-07-04 14:05:50",
                    "comment_num":0,
                    "is_plugin":0,
                    "plugin_id":0,
                    "virtual_sales":1,
                    "goods_video":"",
                    "no_refund":0,
                    "need_address":0,
                    "type2":1,
                    "goods_category_id":2281,
                    "goods_id":653,
                    "category_id":147,
                    "category_ids":"146,147",
                    "buyNum":0,
                    "status_name":"上架",
                    "has_many_specs":[
                        {
                            "id":161,
                            "goods_id":653,
                            "title":"12",
                            "description":null,
                            "has_many_specs_item":[
                                {
                                    "id":465,
                                    "title":"13",
                                    "specid":161,
                                    "thumb":""
                                },
                                {
                                    "id":466,
                                    "title":"14",
                                    "specid":161,
                                    "thumb":""
                                }
                            ]
                        },
                        {
                            "id":162,
                            "goods_id":653,
                            "title":"13",
                            "description":null,
                            "has_many_specs_item":[
                                {
                                    "id":467,
                                    "title":"14",
                                    "specid":162,
                                    "thumb":""
                                },
                                {
                                    "id":468,
                                    "title":"15",
                                    "specid":162,
                                    "thumb":""
                                }
                            ]
                        }
                    ],
                    "has_many_options":[
                        {
                            "id":587,
                            "goods_id":653,
                            "title":"13+14",
                            "thumb":"",
                            "product_price":"80.00",
                            "market_price":"300.00",
                            "stock":5,
                            "specs":"465_467",
                            "weight":"0.00"
                        },
                        {
                            "id":588,
                            "goods_id":653,
                            "title":"13+15",
                            "thumb":"",
                            "product_price":"70.00",
                            "market_price":"300.00",
                            "stock":10,
                            "specs":"465_468",
                            "weight":"0.00"
                        },
                        {
                            "id":589,
                            "goods_id":653,
                            "title":"14+14",
                            "thumb":"",
                            "product_price":"50.00",
                            "market_price":"300.00",
                            "stock":11,
                            "specs":"466_467",
                            "weight":"0.00"
                        },
                        {
                            "id":590,
                            "goods_id":653,
                            "title":"14+15",
                            "thumb":"",
                            "product_price":"60.00",
                            "market_price":"300.00",
                            "stock":11,
                            "specs":"466_468",
                            "weight":"0.00"
                        }
                    ]
                },
                {
                    "id":650,
                    "uniacid":10,
                    "brand_id":0,
                    "type":2,
                    "status":1,
                    "display_order":0,
                    "title":"测试三大队",
                    "thumb":"https://dev7.yunzmall.com/attachment/image/b865b0203556f758626cb2328c96a43e.jpg",
                    "thumb_url":"a:2:{i:0;s:79:"https://dev7.yunzshop.com/attachment/image/7be05109dcdf59e45460ed942f11506a.jpg";i:1;s:79:"https://dev7.yunzshop.com/attachment/image/2bc41028ec658fa59b51e657882f122b.jpg";}",
                    "sku":"15",
                    "description":"",
                    "content":"<p><img src="https://dev7.yunzshop.com/attachment/image/d999e85375b2baac6613f5034c24ef60.jpg" width="100%" alt="8.jpg"/></p><p><img src="https://dev7.yunzshop.com/attachment/image/db1f9cbda3d4485bc75055eb4f6c8db0.jpg" width="100%" alt="8.jpg"/></p>",
                    "goods_sn":"",
                    "product_sn":"",
                    "market_price":"580.00",
                    "price":"129.00",
                    "cost_price":"435.00",
                    "stock":17,
                    "reduce_stock_method":0,
                    "show_sales":1,
                    "real_sales":1,
                    "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":"2019-04-28 10:30:02",
                    "deleted_at":null,
                    "updated_at":"2019-07-10 17:10:03",
                    "comment_num":0,
                    "is_plugin":1,
                    "plugin_id":92,
                    "virtual_sales":0,
                    "goods_video":"",
                    "no_refund":0,
                    "need_address":0,
                    "type2":1,
                    "goods_category_id":2293,
                    "goods_id":650,
                    "category_id":147,
                    "category_ids":"146,147",
                    "buyNum":0,
                    "status_name":"上架",
                    "has_many_specs":[

                    ],
                    "has_many_options":[

                    ]
                }
            ]
        },
        "set":{
            "cat_level":"2",
            "cat_adv_img":"",
            "cat_adv_url":""
        }
    }
}
参数名 类型 说明
total int 分类总条数
per_page int 每页条数
current_page int 当前页码
last_page int 最后一页的页码 URL
next_page_url string 下一页URL
prev_page_url string 上一页URL
from int 第几条开始
to int 第几条结束
data json 分类数据
:----- :----- -----
data分类数据
参数名 类型 说明
id int id
uniacid int uniacid
name string 分类名
thumb string 图片
parent_id int 父类ID
description string 分类描述
display_order int 排序
enabled int 是否显示 0:否 1:是
is_home int 是否推荐 0:不推荐 1:推荐
adv_img string 移动端分类广告图片
adv_url string 分类广告链接
level int 分类级别
advimg_pc string PC端分类广告图片
advurl_pc string PC分类广告链接

返回goods_list商品分页数据参数说明:

参数名 类型 说明
total int 分类总条数
per_page int 每页条数
current_page int 当前页码
last_page int 最后一页的页码 URL
next_page_url string 下一页URL
prev_page_url string 上一页URL
from int 第几条开始
to int 第几条结束
data json 商品列表数据
:----- :----- -----
商品列表数据
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_course int 是否是课程 0 不是 1是
is_new int 是否新上
is_hot int 是否热卖
is_discount int 是否促销
is_recommand int 是否推荐
is_comment int 是否允许评论
min_price float 最小价格,只在有规格时出现
max_price float 最大价格,只在有规格时出现
goods_type int 0-普通商品 1-门店商品 2-课程商品

返回set分类设置参数说明:

参数名 类型 说明
cat_adv_img string 推荐分类广告图片
cat_adv_url string 推荐分类广告连接
cat_level int 分类级别

备注:

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