feat: 支持 Linux 客户端配置与发布校验
This commit is contained in:
@@ -51,6 +51,17 @@ def list_licenses(app_id: str = "", include_deleted: bool = False) -> list:
|
||||
return rows
|
||||
|
||||
|
||||
def get_license_by_hash_with_usage(license_key_hash: str):
|
||||
conn = db.get_conn()
|
||||
row = conn.execute(
|
||||
"""SELECT l.*,(SELECT COUNT(*) FROM license_devices d WHERE d.license_id=l.license_id) used_devices
|
||||
FROM licenses l WHERE l.license_key_hash=? AND l.status<>'deleted'""",
|
||||
(license_key_hash,),
|
||||
).fetchone()
|
||||
conn.close()
|
||||
return row
|
||||
|
||||
|
||||
def set_license_status(license_id: str, status: str) -> int:
|
||||
conn = db.get_conn()
|
||||
cur = conn.execute(
|
||||
|
||||
Reference in New Issue
Block a user