Fix rounding and conversion issues on statistics
This commit is contained in:
@@ -50,11 +50,11 @@
|
||||
return $price;
|
||||
} else {
|
||||
$fromRate = $exchangeRate['rate'];
|
||||
return number_format($price / $fromRate, 2);
|
||||
return $price / $fromRate;
|
||||
}
|
||||
}
|
||||
|
||||
function printSubscriptons($subscriptions, $sort, $categories) {
|
||||
function printSubscriptons($subscriptions, $sort, $categories, $members) {
|
||||
if ($sort === "price") {
|
||||
usort($subscriptions, function($a, $b) {
|
||||
return $a['price'] < $b['price'] ? 1 : -1;
|
||||
@@ -62,6 +62,7 @@
|
||||
}
|
||||
|
||||
$currentCategory = 0;
|
||||
$currentPayerUserId = 0;
|
||||
foreach ($subscriptions as $subscription) {
|
||||
if ($sort == "category_id" && $subscription['category_id'] != $currentCategory) {
|
||||
?>
|
||||
@@ -71,6 +72,14 @@
|
||||
<?php
|
||||
$currentCategory = $subscription['category_id'];
|
||||
}
|
||||
if ($sort == "payer_user_id" && $subscription['payer_user_id'] != $currentPayerUserId) {
|
||||
?>
|
||||
<div class="subscription-list-title">
|
||||
<?= $members[$subscription['payer_user_id']]['name'] ?>
|
||||
</div>
|
||||
<?php
|
||||
$currentPayerUserId = $subscription['payer_user_id'];
|
||||
}
|
||||
?>
|
||||
<div class="subscription">
|
||||
<span class="logo <?= $subscription['hidelogo'] ?>"><img src="<?= $subscription['logo'] ?>"></span>
|
||||
|
||||
Reference in New Issue
Block a user