""" 充值记录历史记录模型 """ from sqlalchemy import Column, Integer, String, DateTime, Numeric, SmallInteger from app.database import Base class RechargeRecordHis(Base): """充值记录表历史记录""" __tablename__ = "recharge_records_his" his_id = Column(Integer, primary_key=True, autoincrement=True, comment="历史记录主键ID") id = Column(Integer, nullable=False, comment="原表主键ID") user_id = Column(Integer, nullable=False, comment="用户ID") card_id = Column(Integer, comment="使用的卡密ID") software_code = Column(String(50), nullable=False, comment="软件特征码") days = Column(Integer, nullable=False, comment="充值天数") amount = Column(Numeric(10, 2), comment="充值金额") expire_time_before = Column(DateTime, comment="充值前到期时间") expire_time_after = Column(DateTime, comment="充值后到期时间") is_deleted = Column(SmallInteger, default=0, comment="是否删除:0-否,1-是") created_at = Column(DateTime, comment="充值时间") his_created_at = Column(DateTime, comment="历史记录创建时间") his_operation = Column(String(10), nullable=False, comment="操作类型:INSERT/UPDATE/DELETE")