From 0dd4b46f502f9aaae44d46ca181cf7a06cd46b45 Mon Sep 17 00:00:00 2001 From: heshupeng <hsp@bronet.cn> Date: Tue, 29 Dec 2020 15:26:25 +0800 Subject: [PATCH] 获取可用优惠券api --- application/api/controller/Coupons.php | 2 +- application/api/controller/Order.php | 32 +++++++++++++++++++++++++++++++- public/api.html | 36 +++++++++++++++++++++++++++++++++--- 3 files changed, 65 insertions(+), 5 deletions(-) diff --git a/application/api/controller/Coupons.php b/application/api/controller/Coupons.php index 5d56b23..10150d2 100644 --- a/application/api/controller/Coupons.php +++ b/application/api/controller/Coupons.php @@ -47,7 +47,7 @@ class Coupons extends Base "gettimestart": 1607875200, "gettimeend": 1610640000, "user_coupons_id": 1, //领取ID - "status_code": 1610640000, //状态码:no_use=未使用,used=已使用,expired=已过期 + "status_code": "no_use", //状态码:no_use=未使用,used=已使用,expired=已过期 "status_name": "未使用" //状态名称 }] }) diff --git a/application/api/controller/Order.php b/application/api/controller/Order.php index 4edc550..965c466 100644 --- a/application/api/controller/Order.php +++ b/application/api/controller/Order.php @@ -375,7 +375,37 @@ class Order extends Base * @ApiHeaders (name=token, type=string, required=true, description="请求的Token") * @ApiParams (name=goods_list, type=object, required=false, description="购买的商品:[{goods_id: 3, goods_num: 1, sku_price_id: 3, goods_price: 0.10}]") * - * @ApiReturn() + * @ApiReturn({ + "code": 1, + "msg": "获取成功", + "time": "1609222988", + "data": [{ + "id": 3, //优惠券ID + "name": "无门槛优惠券", //优惠券名称 + "type": "cash", + "goods_ids": "0", + "amount": "0.01", //券面额 + "enough": "0.00", //消费门槛 + "stock": 99, + "limit": 1, + "gettime": { + "start": 1609171200, + "end": 1609344000 + }, + "usetime": { //有效期 + "start": "2020.12.29", //开始时间 + "end": "2020.12.31" //结束时间 + }, + "description": "", //优惠券描述 + "usetimestart": 1609171200, + "usetimeend": 1609344000, + "gettimestart": 1609171200, + "gettimeend": 1609344000, + "user_coupons_id": 2, //领取ID + "status_code": "no_use", //状态码:no_use=未使用,used=已使用,expired=已过期 + "status_name": "未使用" //状态名称 + }] + }) */ public function coupons () { $params = $this->request->post(); diff --git a/public/api.html b/public/api.html index 6a91cb5..fcb1e9e 100755 --- a/public/api.html +++ b/public/api.html @@ -2469,7 +2469,37 @@ <div class="tab-pane" id="sample47"> <div class="row"> <div class="col-md-12"> - <pre id="sample_response47">无</pre> + <pre id="sample_response47">{ + "code": 1, + "msg": "获取成功", + "time": "1609222988", + "data": [{ + "id": 3, //优惠券ID + "name": "无门槛优惠券", //优惠券名称 + "type": "cash", + "goods_ids": "0", + "amount": "0.01", //券面额 + "enough": "0.00", //消费门槛 + "stock": 99, + "limit": 1, + "gettime": { + "start": 1609171200, + "end": 1609344000 + }, + "usetime": { //有效期 + "start": "2020.12.29", //开始时间 + "end": "2020.12.31" //结束时间 + }, + "description": "", //优惠券描述 + "usetimestart": 1609171200, + "usetimeend": 1609344000, + "gettimestart": 1609171200, + "gettimeend": 1609344000, + "user_coupons_id": 2, //领取ID + "status_code": "no_use", //状态码:no_use=未使用,used=已使用,expired=已过期 + "status_name": "未使用" //状态名称 + }] + }</pre> </div> </div> </div><!-- #sample --> @@ -10614,7 +10644,7 @@ "gettimestart": 1607875200, "gettimeend": 1610640000, "user_coupons_id": 1, //领取ID - "status_code": 1610640000, //状态码:no_use=未使用,used=已使用,expired=已过期 + "status_code": "no_use", //状态码:no_use=未使用,used=已使用,expired=已过期 "status_name": "未使用" //状态名称 }] }</pre> @@ -12492,7 +12522,7 @@ <div class="row mt0 footer"> <div class="col-md-6" align="left"> - Generated on 2020-12-29 14:17:59 </div> + Generated on 2020-12-29 14:29:35 </div> <div class="col-md-6" align="right"> <a href="./" target="_blank">My Website</a> </div> -- libgit2 0.24.0