new feature on sms and some bugs fixed

This commit is contained in:
2026-07-18 22:22:01 +03:30
parent 518334da11
commit fc9de5198c
20 changed files with 489 additions and 95 deletions
@@ -136,8 +136,7 @@ class CartController extends Controller
$data = $request->json()->all();
$user= auth()->user();
if ($user->is_legal == 0 || !$user) {
return response()->json(['massage' => 'شما باید اول خود را احراز هویت کنید'], 422);
throw new UnprocessableEntityHttpException('لطفا ابتدا فرآیند احراز هویت خود را تکمیل کنید');
}
// $data->validate([
@@ -18,9 +18,7 @@ class OrderController extends Controller
public function store(Request $request)
{
$user = auth()->user();
if ($user->is_legal == 0 || $user->id == 4) {
return response()->json(['massage' => 'لطفا ابتدا فرآیند احراز هویت خود را تکمیل کنید'], 422);
}
self::assertCustomerIdentityVerified($user instanceof Customer ? $user : null);
if (!auth('customer')->user()->trade_active) {
throw new UnprocessableEntityHttpException('امکان سفارش برای شما غیرفعال است.');
@@ -419,7 +419,9 @@ class WalletController extends Controller
}
}
User::where('send_sms', 1)->get()->each(function ($admin) use ($message) {
$this->Send($admin->mobile, $message . ' ' . now()->format('H:i:s'));
if (self::isSmsNotifEnabled('sms_notif_withdraw_admin')) {
$this->Send($admin->mobile, $message . ' ' . now()->format('H:i:s'));
}
});
return response()->json($Withdraw);
@@ -583,10 +585,12 @@ class WalletController extends Controller
$otp = rand(1000, 9999);
$customer->token_sms = $otp;
$customer->save();
$this->Send(
$customer->mobile,
'رمز عبور یکبار مصرف شما جهت برداشت پول از اپلیکیشن ' . $this->Config('name_fa') . ' می باشد: ' . $otp
);
if (self::isSmsNotifEnabled('sms_notif_withdraw_otp')) {
$this->Send(
$customer->mobile,
'رمز عبور یکبار مصرف شما جهت برداشت پول از اپلیکیشن ' . $this->Config('name_fa') . ' می باشد: ' . $otp
);
}
return response()->json(true);
}