简要描述:

  • 积分数据统计

请求域名:

  • http://xx.com

请求URL:

POST/route=survey.survey.coupon-statistic

参数:

参数名 类型 是否必须 说明
time_type string 日期类型:day日,week周,month月,不传默认day
start_time int 搜索开始时间戳,不传默认当天开始,根据日期类型不同,传递时间也不同,参考【统计2.0】插件
end_time int 搜索结束时间戳,不传默认当天结束

返回示例:

正确时返回:

{
    "result": 1,
    "msg": "ok",
    "data": {
        "statistic": [
            {
                "name": "已赠送优惠券",
                "tips": "统计筛选时间内,已赠送优惠券总数",
                "value": 331
            },
            {
                "name": "已领取优惠券",
                "tips": "统计筛选时间内,领券中心领取优惠券总数",
                "value": 42
            },
            {
                "name": "已使用优惠券",
                "tips": "统计筛选时间内,已使用优惠券总数",
                "value": 17
            },
            {
                "name": "已过期优惠券",
                "tips": "统计筛选时间内,已过期优惠券总数",
                "value": 5
            },
            {
                "name": "抵扣金额",
                "tips": "统计筛选时间内,使用优惠券抵扣总额",
                "value": 0
            }
        ],
        "chart": {
            "given_coupon": {
                "series": [
                    0,
                    3,
                    0,
                    0,
                    0,
                    29,
                    331
                ],
                "x_axis": [
                    "2020/04",
                    "2020/05",
                    "2020/06",
                    "2020/07",
                    "2020/08",
                    "2020/09",
                    "2020/10"
                ],
                "name": "已赠送优惠券"
            },
            "receive_coupon": {
                "series": [
                    0,
                    0,
                    0,
                    0,
                    0,
                    25,
                    42
                ],
                "x_axis": [
                    "2020/04",
                    "2020/05",
                    "2020/06",
                    "2020/07",
                    "2020/08",
                    "2020/09",
                    "2020/10"
                ],
                "name": "已领取优惠券"
            },
            "used_coupon": {
                "series": [
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    17
                ],
                "x_axis": [
                    "2020/04",
                    "2020/05",
                    "2020/06",
                    "2020/07",
                    "2020/08",
                    "2020/09",
                    "2020/10"
                ],
                "name": "已使用优惠券"
            },
            "expired_coupon": {
                "series": [
                    0,
                    3,
                    0,
                    0,
                    0,
                    21,
                    5
                ],
                "x_axis": [
                    "2020/04",
                    "2020/05",
                    "2020/06",
                    "2020/07",
                    "2020/08",
                    "2020/09",
                    "2020/10"
                ],
                "name": "已过期优惠券"
            },
            "deduction_price": {
                "series": [
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0
                ],
                "x_axis": [
                    "2020/04",
                    "2020/05",
                    "2020/06",
                    "2020/07",
                    "2020/08",
                    "2020/09",
                    "2020/10"
                ],
                "name": "抵扣金额"
            }
        },
        "coupon_data": [
            {
                "name": "发放",
                "get_count": 94
            },
            {
                "name": "领取",
                "get_count": 16
            },
            {
                "name": "签到奖励",
                "get_count": 4
            },
            {
                "name": "其他",
                "get_count": "2"
            }
        ]
    }
}

错误时返回:

  {
    "result": 0,
    "msg": "获取失败"
  }

返回参数说明:

参数名 类型 说明
statistic array 统计数据
coupon_data array 优惠券获取途径
chart array 统计图数据

statistic返回参数说明:

参数名 类型 说明
name string 数据名称
tips string 数据tip
value float 数据值

coupon_data返回参数说明:

参数名 类型 说明
name string 获取方式
get_count int 获取数量

chart返回参数说明:

参数名 类型 说明
name string 统计图数据名称
x_axis array X轴数据
series array Y轴数据

备注:

可以按日期搜索的数据都用单独接口获取