diff --git a/app/Http/Controllers/Customer/OrderController.php b/app/Http/Controllers/Customer/OrderController.php index b99de74..9b16371 100644 --- a/app/Http/Controllers/Customer/OrderController.php +++ b/app/Http/Controllers/Customer/OrderController.php @@ -20,7 +20,7 @@ class OrderController extends Controller public function store(Request $request){ $user= auth()->user(); if ($user->is_legal == 0 or $user->id==4) { - return response()->json(['massage' => 'شما باید اول خود را احراز هویت کنید'], 422); + return response()->json(['massage' => 'لطفا ابتدا فرآیند احراز هویت خود را تکمیل کنید'], 422); } diff --git a/app/Http/Controllers/Customer/WalletController.php b/app/Http/Controllers/Customer/WalletController.php index 427c410..652b007 100644 --- a/app/Http/Controllers/Customer/WalletController.php +++ b/app/Http/Controllers/Customer/WalletController.php @@ -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'));