mirror of
https://github.com/myronblair/tomtomgames
synced 2026-06-30 17:51:08 -05:00
Shade disabled payout methods when admin turns them off
- payout_methods list now includes admin_enabled flag via JOIN on admin_payout_settings - Disabled methods appear at 45% opacity with UNAVAILABLE/DISABLED BY ADMIN badge in both the cashout radio list and profile payout tab; radio is disabled so they can't be selected, but the delete button remains - Set Default button hidden on disabled methods - cashout.php server-side guard rejects submissions using a disabled method type Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -14,7 +14,14 @@ switch ($action) {
|
||||
|
||||
case 'list':
|
||||
$uid = $isAdmin ? (int)($_GET['user_id'] ?? $userId) : $userId;
|
||||
$rows = db()->prepare("SELECT * FROM payout_methods WHERE user_id=? ORDER BY is_default DESC, id ASC");
|
||||
$rows = db()->prepare("
|
||||
SELECT pm.*,
|
||||
COALESCE(aps.is_enabled, 0) AS admin_enabled
|
||||
FROM payout_methods pm
|
||||
LEFT JOIN admin_payout_settings aps ON aps.method_key = pm.method_type
|
||||
WHERE pm.user_id = ?
|
||||
ORDER BY pm.is_default DESC, pm.id ASC
|
||||
");
|
||||
$rows->execute([$uid]);
|
||||
echo json_encode(['success'=>true, 'methods'=>$rows->fetchAll()]);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user