| 123456789101112131415161718192021222324 |
- """
- 充值记录模型
- """
- from datetime import datetime
- from app.utils.timezone import beijing_now_naive
- from sqlalchemy import Column, Integer, String, DateTime, ForeignKey
- from app.database import Base
- class RechargeRecord(Base):
- """充值记录表"""
- __tablename__ = "recharge_records"
-
- id = Column(Integer, primary_key=True, autoincrement=True, comment="主键ID")
- user_id = Column(Integer, nullable=False, comment="用户ID")
- card_id = Column(Integer, nullable=False, comment="卡密ID")
- software_code = Column(String(50), nullable=False, comment="软件特征码")
- days = Column(Integer, nullable=False, comment="充值天数")
- expire_time_before = Column(DateTime, nullable=True, comment="充值前到期时间")
- expire_time_after = Column(DateTime, nullable=True, comment="充值后到期时间")
- created_at = Column(DateTime, default=beijing_now_naive, comment="创建时间")
-
- def __repr__(self):
- return f"<RechargeRecord(id={self.id}, user_id={self.user_id}, card_id={self.card_id})>"
|