优惠券

This commit is contained in:
“wanyongkang”
2021-03-30 21:17:43 +08:00
parent 7ede35d5cf
commit 99e6255230
15 changed files with 141 additions and 53 deletions

View File

@@ -78,7 +78,7 @@ namespace Hncore.Pass.Sells.Service
public async Task<List<UserCouponModel>> GetUserCoupon(int userId)
{
var oroginCoupons = m_CouponUserOrginService.Query(m => m.ToUser == userId);
var oroginCoupons = m_CouponUserOrginService.Query(m => m.ToUser == userId && DateTime.Now <= m.EndTime);
var hasCoupon = from orgin in oroginCoupons
join coupon in this.Query(true) on orgin.CouponId equals coupon.Id
@@ -126,8 +126,6 @@ namespace Hncore.Pass.Sells.Service
public async Task<bool> TaoBaoGive(int userId, int couponId,string taobao)
{
if (m_CouponUserOrginService.Exist(m => (m.ToUser == userId||m.ToUserRef== taobao) && m.CreateDate.Value.Month == DateTime.Now.Month))
return false;
return await this.Give(couponId, "", userId, 1, CouponOriginType.TaoBao,"系统赠送",taobao);
}