This commit is contained in:
苏尹岚
2021-01-08 18:09:01 +08:00
parent 9f73470bc2
commit b161e4d55a
3 changed files with 25 additions and 0 deletions

View File

@@ -413,6 +413,8 @@ type Coupons struct {
ModelIDCULD
CouponType int `json:"couponType"` //优惠券类型 1为总额满减 2为运费优惠
Name string `json:"name"` //优惠券名字
Desc string `json:"desc"` //优惠券详情描述
BeginAt time.Time `json:"beginAt"` //开始时间
EndAt time.Time `json:"endAt"` //到期时间
UpperLimit int `json:"upperLimit"` //满多少

View File

@@ -2148,3 +2148,11 @@ func GetMyPriceDefendOrders(ctx *jxcontext.Context, fromTime, toTime string) (pr
priceDefendOrders, err = dao.GetPriceDefendOrder(db, "", nil, nil, nil, 0, -1, -1, -1, userID, utils.Str2Time(fromTime), utils.Str2Time(toTime), true)
return priceDefendOrders, err
}
func GetCoupons(ctx *jxcontext.Context, couponType int, keyword string) (coupons []*model.Coupons, err error) {
// var (
// db = dao.GetDB()
// )
// coupons, err = dao.GetCoupons(db, couponType, keyword)
return coupons, err
}

View File

@@ -284,3 +284,18 @@ func (c *JxOrderController) TestDefend() {
return retVal, "", err
})
}
// @Title 查询优惠券
// @Description 查询优惠券
// @Param token header string true "认证token"
// @Param couponType query int false "优惠券类型1为商品总额满减2为运费优惠"
// @Param keyword query string false "关键字"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /GetCoupons [get]
func (c *JxOrderController) GetCoupons() {
c.callGetCoupons(func(params *tJxorderGetCouponsParams) (retVal interface{}, errCode string, err error) {
retVal, err = localjx.GetCoupons(params.Ctx, params.CouponType, params.Keyword)
return retVal, "", err
})
}