wallet handling
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user