修改了系统优惠卷 问诊类型
This commit is contained in:
+11
-5
@@ -35,6 +35,11 @@ func (r *CouponService) GetSystemCoupon(couponId int64) (g *dto.CouponDto, err e
|
||||
g = g.LoadCouponGrant(coupon.CouponGrant)
|
||||
}
|
||||
|
||||
// 加载关联问诊类型
|
||||
if coupon.InquiryType != "" {
|
||||
g.LoadInquiryType(coupon.InquiryType)
|
||||
}
|
||||
|
||||
return g, nil
|
||||
}
|
||||
|
||||
@@ -81,7 +86,7 @@ func (r *CouponService) AddSystemCoupon(req requests.AddSystemCoupon) (bool, err
|
||||
// 适用范围-问诊
|
||||
if *req.ApplicationScope == 2 {
|
||||
// 关联问诊类型
|
||||
if req.InquiryType == nil {
|
||||
if len(req.InquiryType) == 0 {
|
||||
return false, errors.New("请填入关联问诊类型")
|
||||
}
|
||||
}
|
||||
@@ -206,8 +211,8 @@ func (r *CouponService) AddSystemCoupon(req requests.AddSystemCoupon) (bool, err
|
||||
}
|
||||
|
||||
// 关联问诊类型
|
||||
if req.InquiryType != nil {
|
||||
coupon.InquiryType = *req.InquiryType
|
||||
if len(req.InquiryType) > 0 {
|
||||
coupon.InquiryType = strings.Join(req.InquiryType, ",")
|
||||
}
|
||||
|
||||
// 发放关联天数
|
||||
@@ -306,8 +311,9 @@ func (r *CouponService) PutSystemCoupon(couponId int64, req requests.PutSystemCo
|
||||
|
||||
// 关联问诊类型
|
||||
if coupon.ApplicationScope == 2 {
|
||||
if req.InquiryType != nil {
|
||||
if *req.InquiryType != coupon.InquiryType {
|
||||
if len(req.InquiryType) > 0 {
|
||||
inquiryType := strings.Join(req.InquiryType, ",")
|
||||
if inquiryType != coupon.InquiryType {
|
||||
couponData["inquiry_type"] = req.InquiryType
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user