ECJiaWiki:Api:goods goods filter api

来自ECJiaWiki
跳到导航 跳到搜索

应用场景

商品列表筛选数据获取

接口名称

goods_filter

请求参数

字段名 变量名 必填 类型 示例值 描述
分类id cat_id int 分类id

举例如下

RC_Api::api('goods', 'goods_filter', array('cat_id' => 1084));

成功举例如下

CONTENT: Array
(
    [category_filter] => Array
        (
            [1084] => Array
                (
                    [cat_id] => 1084
                    [cat_name] => 坚果
                    [measure_unit] => 
                    [parent_id] => 1079
                    [is_show] => 1
                    [show_in_nav] => 0
                    [grade] => 0
                    [sort_order] => 4
                    [has_children] => 0
                    [goods_num] => 0
                    [level] => 2
                    [id] => 1084
                    [name] => 坚果
                    [url] => index.php?m=goods&c=category&a=init&id=1084
                )

        )

    [brands_filter] => 
    [price_filter] => 
    [attr_filter] => Array
        (
        )

)

失败举例如下

CONTENT: ecjia_error Object
(
    [errors:Royalcms\Component\Error\Error:private] => Array
        (
            [invalid_parameter] => Array
                (
                    [0] => 参数无效
                )

        )

    [error_data:Royalcms\Component\Error\Error:private] => Array
        (
        )

)

注:错误编码