fix bug
This commit is contained in:
@@ -297,13 +297,14 @@ class DashboardController extends Controller
|
||||
];
|
||||
|
||||
// Calculate total gold gifts from transactions
|
||||
$giftsGold = 0.0;
|
||||
foreach ($TransactionsAdmin as $TransactionAdmin) {
|
||||
$response['Gifts'] += $TransactionAdmin->gold;
|
||||
$giftsGold += (float) $TransactionAdmin->gold;
|
||||
}
|
||||
$response['Gifts'] = number_format($response['Gifts'], 3);
|
||||
$response['Gifts'] = number_format($giftsGold, 3);
|
||||
|
||||
// Calculate total price of gold gifts
|
||||
$response['GiftsPrise'] = floor($response['Gifts'] * Price::latest()->first()->price);
|
||||
$lastGoldPrice = (float) (Price::latest()->first()?->price ?? 0);
|
||||
$response['GiftsPrise'] = $lastGoldPrice > 0 ? (int) floor($giftsGold * $lastGoldPrice) : 0;
|
||||
// Calculate order-related sums
|
||||
foreach ($ords as $ord) {
|
||||
$response['fullPriceM1'] += abs($ord->total_price_original - $ord->payment_amount);
|
||||
|
||||
Reference in New Issue
Block a user