Mi cuenta: enlace a Battlepay y saldo de créditos bnet
- my_account: añade battlepay_credits (leído de battlenet_accounts.battlePayCredits) - bnet.get_battlepay_credits() defensivo (0 si la columna no existe) - partials/my-account.html: muestra 'Créditos Battlepay' y añade botón 'Tienda del cliente' que enlaza a /es/battlepay/ Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -202,3 +202,15 @@ def get_next_battlenet_index(cursor, bnet_id):
|
||||
def make_game_account_username(bnet_id, index=1):
|
||||
"""Nombre de la cuenta de juego: ``<bnetId>#<index>`` (como TrinityCore)."""
|
||||
return f"{bnet_id}#{index}"
|
||||
|
||||
|
||||
def get_battlepay_credits(cursor, bnet_id):
|
||||
"""Créditos Battlepay de la cuenta bnet (0 si la columna no existe)."""
|
||||
if not bnet_id:
|
||||
return 0
|
||||
try:
|
||||
cursor.execute("SELECT battlePayCredits FROM battlenet_accounts WHERE id = %s", [bnet_id])
|
||||
row = cursor.fetchone()
|
||||
return row[0] if row and row[0] is not None else 0
|
||||
except Exception:
|
||||
return 0
|
||||
|
||||
Reference in New Issue
Block a user