初始化项目
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user