1、新增优惠券,编辑优惠券增加入参SmsContent;

This commit is contained in:
chenlin 2024-12-06 14:26:12 +08:00
parent e942715617
commit 56e5ac695b

View File

@ -111,6 +111,7 @@ type ErpMarketingCouponCreateReq struct {
Amount uint32 `json:"amount" validate:"required"` // 金额(元)
UserType uint32 `json:"user_type" validate:"required"` // 领取人限制1-所有人 2-未付费用户 3-已付费用户 4-尊享会员
Limit uint32 `json:"limit"` // 优惠券叠加限制 0-不限制1-仅限原价购买时使用
SmsContent string `json:"sms_content" validate:"required"` // 短信提示内容
}
// ErpMarketingCouponEditReq 编辑优惠券入参
@ -125,6 +126,7 @@ type ErpMarketingCouponEditReq struct {
Amount uint32 `json:"amount" validate:"required"` // 金额(元)
UserType uint32 `json:"user_type" validate:"required"` // 领取人限制1-所有人 2-未付费用户 3-已付费用户 4-尊享会员
Limit uint32 `json:"limit"` // 优惠券叠加限制 0-不限制1-仅限原价购买时使用
SmsContent string `json:"sms_content" validate:"required"` // 短信提示内容
}
// ErpMarketingCouponDetailReq 优惠券详情入参
@ -255,6 +257,7 @@ func CreateErpMarketingCoupon(req *ErpMarketingCouponCreateReq) error {
UserType: req.UserType,
Limit: req.Limit,
State: ErpCouponUnStarted,
SmsContent: req.SmsContent,
}
err := orm.Eloquent.Create(erpCoupon).Error
@ -310,6 +313,7 @@ func EditErpMarketingCoupon(req *ErpMarketingCouponEditReq) error {
erpCoupon.Amount = req.Amount * 100
erpCoupon.UserType = req.UserType
erpCoupon.Limit = req.Limit
erpCoupon.SmsContent = req.SmsContent
begin := orm.Eloquent.Begin()
err = begin.Model(&ErpCoupon{}).Where("id = ?", req.ErpCouponId).