mirror of
https://github.com/getnamingo/registry.git
synced 2025-07-26 04:18:29 +02:00
Fixed to show correct currency in earnings report
This commit is contained in:
parent
7bb9385af7
commit
eba9ffdad6
2 changed files with 3 additions and 4 deletions
|
@ -18,12 +18,11 @@ class ReportsController extends Controller
|
|||
}
|
||||
|
||||
$stats = [];
|
||||
$currency = $_SESSION['_currency'] ?? 'USD';
|
||||
$db = $this->container->get('db');
|
||||
$totalDomains = $db->select('SELECT COUNT(name) as total FROM domain');
|
||||
$numT = $totalDomains[0]['total'] ?? 1;
|
||||
|
||||
$registrars = $db->select('SELECT id, name FROM registrar');
|
||||
$registrars = $db->select('SELECT id, name, currency FROM registrar');
|
||||
foreach ($registrars as $registrar) {
|
||||
$domainCount = $db->select(
|
||||
'SELECT COUNT(name) as count FROM domain WHERE clid = ?',
|
||||
|
@ -38,7 +37,7 @@ class ReportsController extends Controller
|
|||
$stats[] = [
|
||||
'id' => $registrar['id'],
|
||||
'registrar' => $registrar['name'],
|
||||
'currency' => $currency,
|
||||
'currency' => $registrar['currency'],
|
||||
'number' => $domainCount[0]['count'] ?? 0,
|
||||
'share' => $numT > 0
|
||||
? number_format(($domainCount[0]['count'] ?? 0) / $numT * 100, 2)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue