修改了 系统优惠卷详情 ,增加发放记录
This commit is contained in:
@@ -22,7 +22,7 @@ type CouponService struct {
|
||||
// GetSystemCoupon 系统优惠卷详情
|
||||
func (r *CouponService) GetSystemCoupon(couponId int64) (g *dto.CouponDto, err error) {
|
||||
couponDao := dao.CouponDao{}
|
||||
coupon, err := couponDao.GetCouponById(couponId)
|
||||
coupon, err := couponDao.GetCouponPreloadById(couponId)
|
||||
if err != nil || coupon == nil {
|
||||
return nil, errors.New(err.Error())
|
||||
}
|
||||
@@ -30,6 +30,11 @@ func (r *CouponService) GetSystemCoupon(couponId int64) (g *dto.CouponDto, err e
|
||||
// 处理返回值
|
||||
g = dto.GetCouponDto(coupon)
|
||||
|
||||
// 加载发放优惠卷数据
|
||||
if len(coupon.CouponGrant) > 0 {
|
||||
g = g.LoadCouponGrant(coupon.CouponGrant)
|
||||
}
|
||||
|
||||
return g, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user