1.修改电话号码格式为60前缀,马来西亚格式

2.优化渠道可以查看分红方式,可以查看游玩详情
This commit is contained in:
2026-05-30 11:09:54 +08:00
parent 28d0100d5a
commit e65c3474bd
37 changed files with 1772 additions and 113 deletions

View File

@@ -0,0 +1,29 @@
<?php
declare(strict_types=1);
namespace app\common\library;
/**
* 马来西亚手机号60 国际前缀,不含 +
*/
class MalaysiaMobilePhone
{
public const PATTERN = '/^60(1[0-9])\d{7,9}$/';
public static function isValid(string $phone): bool
{
return $phone !== '' && preg_match(self::PATTERN, $phone) === 1;
}
public static function maskInNickname(string $text): string
{
$masked = preg_replace_callback(
self::PATTERN,
static fn(array $matches): string => substr($matches[0], 0, 3) . '****' . substr($matches[0], -4),
$text
);
return is_string($masked) ? $masked : $text;
}
}