fix sms bugs

This commit is contained in:
2026-06-16 20:38:48 +03:30
parent 8bdec7a47f
commit 3e70b1ab43
2 changed files with 19 additions and 5 deletions
+14
View File
@@ -59,6 +59,20 @@ class Controller extends BaseController
return $list;
}
/** مبلغ ریالی در پیامک — جداکننده هزارگان */
public static function formatSmsRialAmount(float|int|string $value): string
{
return number_format(abs((float) $value), 0, '.', ',');
}
/** وزن طلا در پیامک — تا ۳ رقم اعشار، بدون گرد کردن به صفر برای زیر ۱ گرم */
public static function formatSmsGoldWeight(float|int|string $value): string
{
$formatted = rtrim(rtrim(number_format(abs((float) $value), 3, '.', ''), '0'), '.');
return $formatted !== '' ? $formatted : '0';
}
public static function Send($to , $msg, $is_customer = true)
{
$r = self::SendMessage($to , $msg, $is_customer);