diff --git a/app/command/ExportExcel.php b/app/command/ExportExcel.php index e7bbab7..4c7a63d 100644 --- a/app/command/ExportExcel.php +++ b/app/command/ExportExcel.php @@ -92,14 +92,14 @@ class ExportExcel extends Command $type = array_search($type, $typeArr); if ($taxId) { if ($type === 1) { - $str = '0-9A-HJ-NPQRTUWXY'; - $pattern = '/^[' . $str . ']{2}\d{6}[' . $str . ']{10}$/'; + $pattern = '/^\d{15}$|^\d{17}[\dXx]$/'; if (!preg_match($pattern, $taxId)) { $error_array[] = "第{$key}行:纳税人编号格式不符合"; continue; } } else { - $pattern = '/^\d{15}$|^\d{17}[\dXx]$/'; + $str = '0-9A-HJ-NPQRTUWXY'; + $pattern = '/^[' . $str . ']{2}\d{6}[' . $str . ']{10}$/'; if (!preg_match($pattern, $taxId)) { $error_array[] = "第{$key}行:纳税人编号格式不符合"; continue; diff --git a/app/controller/admin/WechatUser.php b/app/controller/admin/WechatUser.php index 7676606..503b337 100644 --- a/app/controller/admin/WechatUser.php +++ b/app/controller/admin/WechatUser.php @@ -171,14 +171,14 @@ class WechatUser extends Base $type = array_search($type, $typeArr); if ($taxId) { if ($type === 1) { - $str = '0-9A-HJ-NPQRTUWXY'; - $pattern = '/^[' . $str . ']{2}\d{6}[' . $str . ']{10}$/'; + $pattern = '/^\d{15}$|^\d{17}[\dXx]$/'; if (!preg_match($pattern, $taxId)) { $error_array[] = "第{$key}行:纳税人编号格式不符合"; continue; } } else { - $pattern = '/^\d{15}$|^\d{17}[\dXx]$/'; + $str = '0-9A-HJ-NPQRTUWXY'; + $pattern = '/^[' . $str . ']{2}\d{6}[' . $str . ']{10}$/'; if (!preg_match($pattern, $taxId)) { $error_array[] = "第{$key}行:纳税人编号格式不符合"; continue;