fix bug
This commit is contained in:
@@ -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');
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user