简要描述:

初进优惠券统计页面获取所有统计数据

请求URL:

GET/plugin.shop-statistics.backend.coupon.get-coupon-statistic

返回示例:

正确时返回:

{
	"result": 1,
	"msg": "ok",
	"data": {
		"cumulative_data": {
			"givenCoupon": 38,
			"usedCoupon": "3",
			"expiredCoupon": 0,
			"receiveCoupon": "6"
		},
		"coupon_statistic": {
			"given_coupon": {
				"name": "已赠送优惠券",
				"y_axis": [
					38,
					38,
					38,
					38,
					38,
					38,
					38
				],
				"value": 38,
				"x_axis": [
					"07/16",
					"07/17",
					"07/18",
					"07/19",
					"07/20",
					"07/21",
					"07/22"
				]
			},
			"receive_coupon": {
				"name": "已领取优惠券",
				"y_axis": [
					"6",
					"6",
					"6",
					"6",
					"6",
					"6",
					"6"
				],
				"value": "6",
				"x_axis": [
					"07/16",
					"07/17",
					"07/18",
					"07/19",
					"07/20",
					"07/21",
					"07/22"
				]
			},
			"used_coupon": {
				"name": "已使用优惠券",
				"y_axis": [
					"3",
					"3",
					"3",
					"3",
					"3",
					"3",
					"3"
				],
				"value": "3",
				"x_axis": [
					"07/16",
					"07/17",
					"07/18",
					"07/19",
					"07/20",
					"07/21",
					"07/22"
				]
			},
			"expired_coupon": {
				"name": "已过期优惠券",
				"y_axis": [
					0,
					0,
					0,
					0,
					0,
					0,
					0
				],
				"value": 0,
				"x_axis": [
					"07/16",
					"07/17",
					"07/18",
					"07/19",
					"07/20",
					"07/21",
					"07/22"
				]
			},
			"deduction_price": {
				"name": "抵扣金额",
				"y_axis": [
					"25.00",
					"25.00",
					"25.00",
					"25.00",
					"25.00",
					"25.00",
					"25.00"
				],
				"value": "25.00",
				"x_axis": [
					"07/16",
					"07/17",
					"07/18",
					"07/19",
					"07/20",
					"07/21",
					"07/22"
				]
			}
		},
		"coupon_ranking": {
			"current_page": 1,
			"data": [
				{
					"id": 2,
					"name": "测试",
					"receiveCoupon": 3
				},
				{
					"id": 1,
					"name": "优惠券",
					"receiveCoupon": 2
				},
				{
					"id": 3,
					"name": "测试",
					"receiveCoupon": 1
				}
			],
			"first_page_url": "http://yzmall.com/admin/shop?page=1",
			"from": 1,
			"last_page": 1,
			"last_page_url": "http://yzmall.com/admin/shop?page=1",
			"next_page_url": null,
			"path": "http://yzmall.com/admin/shop",
			"per_page": 10,
			"prev_page_url": null,
			"to": 3,
			"total": 3
		}
	}
}

返回参数说明:

参数名 类型 说明
cumulative_data array 累计数据
cumulative_data.givenCoupon float 已赠送优惠券
cumulative_data.usedCoupon float 已使用优惠券
cumulative_data.expiredCoupon float 已过期优惠券
cumulative_data.receiveCoupon float 已领取优惠券
coupon_statistic array 优惠券统计图数据
coupon_statistic.name string 优惠券数据类型名
coupon_statistic.value int/float 该类型在搜索时间内的值
coupon_statistic.x_axis array 该统计数据类型x轴数据
coupon_statistic.y_axis array 该统计数据类型y轴数据
coupon_ranking array 优惠券领取排名数据(分页)
coupon_ranking.data[].id int 优惠券ID
coupon_ranking.data[].name string 优惠券名称
coupon_ranking.data[].receiveCoupon string 领取数量