Skip to content

MA商品分析分页优化

MA商品分析分页优化

/report/orders

开发测试环境: http://[manage/station/bshop].devhost.guanmai.cn:32878

接口名只是临时设计成这样,等完善了之后替换掉老接口 /report/skus

request
    # 第一部分,和老接口 /report/skus 定义一样
    search_type
    search_text
    time_config_id
    start_time
    end_time
    station_list
    salemenu_list
    pinlei_ids
    category1_ids
    category2_ids
    # 第二部分,分页用的字段,相关定义可以看 https://doc.guanmai.cn/模块文档/分页/
    page_obj    str     O
    reverse     bool    O
    limit       int     O
    offset      int     O
    peek        int     O
    count       bool    O
response
    {
        data: {
            orders: [
                {
                    "id": "PL00001",
                    "date_time": "2018-09-19 14:32:58",
                    "station_id": "T7936",
                    "station_name": "喵喵总仓",
                    "address_id": "115640",
                    "address_name": "宝安",
                    "is_out_stock": true,
                    "skus": [
                        {
                            # id 和名字:
                            "sku_id": "D4207946",
                            "sku_name": "海天白醋 10.5L",
                            "spu_id": "C1377013",
                            "spu_name": "海天白醋 10.5L",
                            "category_id_1":"A7663",
                            "category_id_1_name": "调味制品",
                            "category_id_2": "B37063",
                            "category_id_2_name": "调味酱汁类(液态)",
                            # 商品本身的信息:
                            "sale_price": 1300,  # 销售单价,单位分
                            "sale_unit_name": "桶",  # 销售单位
                            "std_unit_name": "桶",  # 基本单位,单位分
                            "std_sale_price": 1300,  # 基本单价
                            "sale_ratio": 1,  # 规格转换,1 * std_unit_name = sale_ratio * sale_unit_name
                            # 和订单有关的信息:
                            "cost": 0,  # 成本
                            "accept_std_count": 1,  # 记账数(基本单位)
                            "quantity": 1,  # 下单数量(包含损耗)
                            "real_quantity": 1,  # 出库数(销售单位)
                            "real_std_count": 1,  # 出库数(基本单位)
                            "tax": 0,  # 税额,单位分
                            "abnormal_money": 0,  # 异常金额
                            "abnormal_quantity": 0,  # 异常数量(基本单位)= final_amount - real_std_count
                            "real_refund_amount": 0,  # 退货数量(销售单价)
                            "real_refund_money": 0,  # 退货金额
                        }
                        ...
                    ]
                },
                {
                    "_id": "PL00002",
                    .....
                },
                .....
            ]
        },
        // 关于 pagination 的内容可以看 https://doc.guanmai.cn/模块文档/分页/
        "pagination": {
            "more": true,
            "page_obj": "gtyuhbgyhbvgyhgvgy",
            "count": 2000
        },
        "code": 0,
        "msg": "ok"
    }