mirror of
https://github.com/myronblair/tomtomgames
synced 2026-06-30 17:51:08 -05:00
Initial commit
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/../includes/config.php';
|
||||
require_once __DIR__ . '/../includes/db.php';
|
||||
|
||||
header('Content-Type: application/json');
|
||||
|
||||
// Test what the referrals API would return for each user
|
||||
$users = db()->query("SELECT id, username, referral_code FROM users")->fetchAll();
|
||||
$out = [];
|
||||
foreach ($users as $u) {
|
||||
$out[] = [
|
||||
'id' => $u['id'],
|
||||
'username' => $u['username'],
|
||||
'referral_code' => $u['referral_code'],
|
||||
'referral_url' => 'https://tomtomgames.com/?ref=' . $u['referral_code'],
|
||||
];
|
||||
}
|
||||
|
||||
// Also check tiers
|
||||
$tiers = db()->query("SELECT id, name, min_referrals, tokens_per_ref, bonus_tokens, is_active FROM referral_tiers ORDER BY sort_order")->fetchAll();
|
||||
|
||||
echo json_encode([
|
||||
'users' => $out,
|
||||
'tiers' => $tiers,
|
||||
'tier_count' => count($tiers),
|
||||
], JSON_PRETTY_PRINT);
|
||||
Reference in New Issue
Block a user