wallet handling

This commit is contained in:
2026-06-15 12:05:36 +03:30
parent dee041dfc6
commit b1ae6e159e
2 changed files with 83 additions and 11 deletions
@@ -119,6 +119,17 @@ class CustomerController extends Controller
}
}
$mainWalletGoldWeight = (float) ($wallet->count_gold_wallet ?? 0);
if ($mainWalletGoldWeight > 0) {
$liveGold = (int) app(\App\Services\ProductDisplayPriceService::class)->resolveAppBasePrice();
if ($liveGold <= 0) {
$liveGold = (int) (\App\Models\Price::latest('id')->value('price') ?? 0);
}
if ($liveGold > 0) {
$count_cash_from_gold += $mainWalletGoldWeight * $liveGold;
}
}
$count_cash_total = $count_cash_from_gold + $count_cash_from_silver + $count_cash_from_copper + $count_cash_pure;
$wallet->count_cash_wallets = $count_cash_total - $wallet->count_cash_wallet;