update
This commit is contained in:
parent
3f61f203d5
commit
804584550e
@ -359,14 +359,13 @@ def issue_register_coupons(db: Session, user_id: int):
|
||||
register_coupons = settings.REGISTER_COUPONS
|
||||
|
||||
# 设置过期时间
|
||||
expire_time = datetime.now() + timedelta(days=register_coupons["expire_days"])
|
||||
|
||||
for config in register_coupons:
|
||||
coupon = db.query(CouponDB).filter(
|
||||
CouponDB.id == config["coupon_id"]
|
||||
).first()
|
||||
|
||||
if coupon:
|
||||
expire_time = datetime.now() + timedelta(days=config["expire_days"])
|
||||
for _ in range(config["count"]):
|
||||
user_coupon = UserCouponDB(
|
||||
user_id=user_id,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user