docker,字段更改

This commit is contained in:
lhx
2025-09-27 10:23:00 +08:00
parent 524be063d0
commit e6fe0fab48
4 changed files with 20 additions and 20 deletions

View File

@@ -15,17 +15,17 @@ class AccountService:
@staticmethod
def search_accounts(db: Session, account_id: Optional[int] = None,
account: Optional[str] = None, section: Optional[str] = None,
username: Optional[str] = None, project_name: Optional[str] = None,
status: Optional[int] = None, today_updated: Optional[int] = None) -> List[Account]:
"""根据多种条件搜索账号"""
query = db.query(Account)
if account_id is not None:
query = query.filter(Account.id == account_id)
if account is not None:
query = query.filter(Account.account.like(f"%{account}%"))
if section is not None:
query = query.filter(Account.section.like(f"%{section}%"))
if username is not None:
query = query.filter(Account.username.like(f"%{username}%"))
if project_name is not None:
query = query.filter(Account.project_name.like(f"%{project_name}%"))
if status is not None:
query = query.filter(Account.status == status)
if today_updated is not None:
@@ -39,9 +39,9 @@ class AccountService:
return db.query(Account).filter(Account.id == account_id).first()
@staticmethod
def get_account_by_account(db: Session, account: str) -> Optional[Account]:
"""根据账号名获取账号"""
return db.query(Account).filter(Account.account == account).first()
def get_account_by_username(db: Session, username: str) -> Optional[Account]:
"""根据用户名获取账号"""
return db.query(Account).filter(Account.username == username).first()
@staticmethod
def get_accounts(db: Session, skip: int = 0, limit: int = 100) -> List[Account]: