fix pargar bugs 2

This commit is contained in:
2026-07-21 13:25:18 +03:30
parent d43c5e1f25
commit 49e80a1b97
17 changed files with 228 additions and 106 deletions
+11 -4
View File
@@ -83,12 +83,12 @@ class AuthController extends Controller
protected function _loginWithSms($mobile, $provider)
{
$cfg = app(ConfigService::class);
if ($provider == 'user') {
$user = User::where('mobile', $mobile)->first();
$subDomain = $this->Config('admin_url');
} else {
$user = Customer::where('mobile', $mobile)->first();
$subDomain = $this->Config('app_url');
}
if (is_null($user)) {
throw new UnprocessableEntityHttpException(trans('لطفا ابتدا ثبت نام بفرمایید'));
@@ -105,7 +105,14 @@ class AuthController extends Controller
$user->save();
if (self::isSmsNotifEnabled('sms_notif_login_otp')) {
$this->SendMessage($mobile, 'رمز عبور یکبار مصرف شما جهت ورود به اپلیکشن ' . $this->Config('name_fa') . ' ' . $rand . ' می باشد' . PHP_EOL . "@$subDomain" . " #" . $rand,true ,"sms");
$otpHost = $cfg->resolvePublicHost(request());
$otpLine = $otpHost !== '' ? PHP_EOL . "@{$otpHost} #{$rand}" : '';
$this->SendMessage(
$mobile,
'رمز عبور یکبار مصرف شما جهت ورود به اپلیکشن ' . $this->Config('name_fa') . ' ' . $rand . ' می باشد' . $otpLine,
true,
'sms'
);
}
return $user->id;
@@ -229,7 +236,7 @@ class AuthController extends Controller
$message .= "\nپس از اولین خرید مقدار، " . number_format((int) ($bonusValues[0]['customer'] ?? 0)) . ' ریال پاداش دریافت خواهید کرد.';
}
}
$message .= "\nنام کاربری: {$data['mobile']}\nورود به نرم افزار: {$this->Config('app_url')}";
$message .= "\nنام کاربری: {$data['mobile']}\nورود به نرم افزار: " . self::publicSiteUrl(request());
if (self::isSmsNotifEnabled('sms_notif_register_customer')) {
$this->Send($data['mobile'], $message);
}