增加 注册送券的过期时间。
This commit is contained in:
parent
67b04950cc
commit
31d1083968
@ -311,8 +311,8 @@ def issue_register_coupons(db: Session, user_id: int):
|
||||
"""
|
||||
register_coupons = settings.REGISTER_COUPONS
|
||||
|
||||
# 设置过期时间为3个月后
|
||||
expire_time = datetime.now() + timedelta(days=90)
|
||||
# 设置过期时间
|
||||
expire_time = datetime.now() + timedelta(days=register_coupons["expire_days"])
|
||||
|
||||
for config in register_coupons:
|
||||
coupon = db.query(CouponDB).filter(
|
||||
@ -332,7 +332,7 @@ def issue_register_coupons(db: Session, user_id: int):
|
||||
db.add(user_coupon)
|
||||
|
||||
@router.get("/list", response_model=ResponseModel)
|
||||
async def get_user_list(
|
||||
async def get_list(
|
||||
skip: int = 0,
|
||||
limit: int = 10,
|
||||
role: Optional[str] = None,
|
||||
|
||||
@ -53,7 +53,7 @@ class Settings(BaseSettings):
|
||||
|
||||
# 注册赠券配置
|
||||
REGISTER_COUPONS: list = [
|
||||
{"coupon_id": 1, "count": 3},
|
||||
{"coupon_id": 1, "count": 3, "expire_days": 15},
|
||||
]
|
||||
|
||||
WECHAT_APPID: str = "wx3cc5b7dcb28f2756"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user