This commit is contained in:
2026-06-14 21:09:43 +03:30
parent 6f86e8242c
commit b84b2df01a
9 changed files with 287 additions and 66 deletions
@@ -583,13 +583,17 @@ class SingleOrderController extends Controller
User::where('send_sms', 1)->get()->each(function ($admin) use ($message, $data, $transactionType, $companyName) {
$this->send($admin->mobile, $message);
});
$wallet = Wallet::where('owner', $data['customer_id'])->whereNull('fund_id')->first();
$wallet = Wallet::where('owner', $data['customer_id'])
->whereNull('fund_id')
->whereNull('product_id')
->first();
$balanceLabel = self::metalTypeLabel();
// $pricePerGram = $totalPrice / $amount;
$goldBalance = $wallet ? ($wallet->gold ?? 0) : 0;
$cashBalance = $wallet ? ($wallet->cash ?? 0) : 0;
$customerMessage = "$companyName\n$transactionType {$subjectTitle}\nگرم: {$amount}\n" .
"مبلغ کل: " . number_format($totalPrice) . "\n\n" .
"موجودی {$balanceLabel}: {$wallet->gold}\n" .
"مانده ریالی: " . number_format($wallet->cash) . "\n" .
"موجودی {$balanceLabel}: {$goldBalance}\n" .
"مانده ریالی: " . number_format($cashBalance) . "\n" .
$this->Config('app_url');