From 1a8a237392ee2ae86cc0cfa3d41d072b3ebf5ed5 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Wed, 18 Sep 2024 16:29:12 +0800 Subject: [PATCH] 1 --- app/db/model/community_team_coupon_user.go | 30 +++++++++++----------- app/router/router.go | 2 +- app/svc/svc_order.go | 2 +- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/app/db/model/community_team_coupon_user.go b/app/db/model/community_team_coupon_user.go index cf2f69f..9d49963 100644 --- a/app/db/model/community_team_coupon_user.go +++ b/app/db/model/community_team_coupon_user.go @@ -5,19 +5,19 @@ import ( ) type CommunityTeamCouponUser struct { - Id int64 `json:"id" xorm:"pk autoincr BIGINT(20)"` - Uid int `json:"uid" xorm:"comment('用户id') index INT(11)"` - MerchantSchemeId int `json:"merchant_scheme_id" xorm:"comment('优惠券方案的id') INT(11)"` - IsUse int `json:"is_use" xorm:"comment('是否已使用:0否1是2失效') TINYINT(1)"` - Kind int `json:"kind" xorm:"comment('优惠券类型:1立减2满减3折扣') TINYINT(1)"` - Cal string `json:"cal" xorm:"not null default '0.00' comment('折扣算法json:形式:{"reach":"10.00", "reduce":"1.00"},无门槛reach为0') VARCHAR(255)"` - ValidTimeStart time.Time `json:"valid_time_start" xorm:"comment('有效日期开始') DATETIME"` - ValidTimeEnd time.Time `json:"valid_time_end" xorm:"comment('有效日期结束') DATETIME"` - CreateTime time.Time `json:"create_time" xorm:"default CURRENT_TIMESTAMP comment('创建时间') DATETIME"` - UpdateTime time.Time `json:"update_time" xorm:"default CURRENT_TIMESTAMP comment('更新时间') DATETIME"` - StoreId int `json:"store_id" xorm:"default 0 comment('0是官方') INT(11)"` - StoreType int `json:"store_type" xorm:"default 0 comment('0官方自营店 1加盟店 2连锁店') INT(11)"` - Name string `json:"name" xorm:"comment('方案名称') VARCHAR(255)"` - ActivityStatement string `json:"activity_statement" xorm:"not null default '0' comment('活动规则说明') VARCHAR(5000)"` - Img string `json:"img" xorm:"VARCHAR(255)"` + Id int64 `json:"id" xorm:"pk autoincr BIGINT(20)"` + Uid int `json:"uid" xorm:"comment('用户id') index INT(11)"` + MerchantSchemeId int `json:"merchant_scheme_id" xorm:"comment('优惠券方案的id') INT(11)"` + IsUse int `json:"is_use" xorm:"comment('是否已使用:0否1是2失效') TINYINT(1)"` + Kind int `json:"kind" xorm:"comment('优惠券类型:1立减2满减3折扣') TINYINT(1)"` + Cal string `json:"cal" xorm:"not null default '0.00' comment('折扣算法json:形式:{"reach":"10.00", "reduce":"1.00"},无门槛reach为0') VARCHAR(255)"` + ValidTimeStart time.Time `json:"valid_time_start" xorm:"comment('有效日期开始') DATETIME"` + ValidTimeEnd time.Time `json:"valid_time_end" xorm:"comment('有效日期结束') DATETIME"` + CreateTime time.Time `json:"create_time" xorm:"default CURRENT_TIMESTAMP comment('创建时间') DATETIME"` + UpdateTime time.Time `json:"update_time" xorm:"default CURRENT_TIMESTAMP comment('更新时间') DATETIME"` + StoreId int `json:"store_id" xorm:"default 0 comment('0是官方') INT(11)"` + StoreType int `json:"store_type" xorm:"default 0 comment('0官方自营店 1加盟店 2连锁店') INT(11)"` + Name string `json:"name" xorm:"comment('方案名称') VARCHAR(255)"` + Info string `json:"info" xorm:"not null default '0' comment('活动规则说明') VARCHAR(5000)"` + Img string `json:"img" xorm:"VARCHAR(255)"` } diff --git a/app/router/router.go b/app/router/router.go index c730b07..372b446 100644 --- a/app/router/router.go +++ b/app/router/router.go @@ -54,10 +54,10 @@ func routeCommunityTeam(r *gin.RouterGroup) { r.POST("/goods", hdl.Goods) r.POST("/goods/sku", hdl.GoodsSku) r.POST("/coupon", hdl.Coupon) - r.POST("/coupon/receive", hdl.CouponReceive) r.GET("/user", hdl.User) // 用户授权后调用的接口 r.Use(mw.AuthJWT) + r.POST("/coupon/receive", hdl.CouponReceive) r.POST("/store/addLike", hdl.StoreAddLike) r.POST("/store/cancelLike", hdl.StoreCancelLike) r.POST("/goods/coupon", hdl.GoodsCoupon) diff --git a/app/svc/svc_order.go b/app/svc/svc_order.go index ad07670..eaa2da8 100644 --- a/app/svc/svc_order.go +++ b/app/svc/svc_order.go @@ -261,7 +261,7 @@ func CommCoupon(c *gin.Context, totalPrice string) map[string]interface{} { Timer: item.ValidTimeStart.Format("2006.01.02") + "-" + item.ValidTimeEnd.Format("2006.01.02"), Label: "全部商品可用", Img: item.Img, - Content: item.ActivityStatement, + Content: item.Info, IsCanUse: "0", NotUseStr: "", }