初始化项目
Some checks failed
Tests / PHP 8.2 (push) Has been cancelled
Tests / PHP 8.3 (push) Has been cancelled
Tests / PHP 8.4 (push) Has been cancelled

This commit is contained in:
2025-05-19 16:54:25 +08:00
parent fa27b46caf
commit 5bd5938e5c
26 changed files with 2638 additions and 0 deletions

View File

@@ -162,6 +162,22 @@ class UtilsService
}
}
/**
* 检查身份证号格式
* @param string $idCard
* @return true|void
* @throws Exception
*/
public function checkIdCard(string $idCard)
{
$idCard = trim($idCard);
if (preg_match('/^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/', $idCard)) {
return true;
} else {
self::errorThrow('身份证号格式不正确');
}
}
/**
* 生成订单号
* @param int $type