fix sms bugs
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user