fixed withdraw error and title for sts 4

This commit is contained in:
2026-05-23 13:30:05 +03:30
parent 9b4b4f3245
commit 3f136432fa
2 changed files with 15 additions and 6 deletions
@@ -71,7 +71,7 @@ class WalletController extends Controller
$q->select(['*', Order::$SELECT_STS_STR]);
},
'withdraw' => function ($q) {
$q->select(['*', Order::$SELECT_STS_STR]);
$q->select(['*', Withdraw::$SELECT_STS_STR]);
},
'wallet.product'
])->whereIn('wallet', $wallet->pluck('id'))->whereNull('fund_id');
@@ -102,6 +102,15 @@ class WalletController extends Controller
}
}
if (
(int) $record->type === 4 &&
isset($record->withdraw) &&
(int) $record->withdraw->sts === 4
) {
$record->title = "واریز ریالی";
} else {
$record->title = $record->type_str;
}
$record->save();
}
@@ -146,11 +155,11 @@ class WalletController extends Controller
$customer = auth('customer')->user();
$data = $request->all();
if (!isset($data['card_id'])) {
return response()->json(['message' => 'کارت انتخاب نشده'], 422);
return response()->json(['message' => 'لطفا کارت بانکی را وارد کنید'], 422);
}
$bCart = BankAccount::where('id', $data['card_id'])->first();
if ($bCart->sts != 2) {
return response()->json(['message' => 'کارت انتخاب شده غیر فعال است یا ردشده'], 422);
return response()->json(['message' => 'کارت انتخاب شده نا معتبر است'], 422);
}
$wallet_interface_fund = new WalletInterface(auth('customer')->id(), auth('customer')->user()->type);
@@ -192,7 +201,7 @@ class WalletController extends Controller
if (Customer::where("id", $customer->id)->first()->token_sms != $request->otp) {
return response()->json(['message' => 'رمز دوم اشتباه میباشد'], 422);
}
try {
/* try {
$response = Http::withHeaders([
'Authorization' => 'Bearer ' . $this->Config('liman_token')
])->post('https://limangold.ir/kernel/customer/fin', [
@@ -212,7 +221,7 @@ class WalletController extends Controller
}
} catch (Exception $e) {
$message = "کاربر $userName با شماره موبایل $userMobile درخواست برداشت مبلغ " . number_format($withdrawAmount) . " ریال را دارد. با تشکر، $companyName";
}
}*/
}
User::where('send_sms', 1)->get()->each(function ($admin) use ($message) {
$this->Send($admin->mobile, $message . ' ' . now()->format('H:i:s'));