修复工单名称纯数字

This commit is contained in:
root
2026-07-19 01:00:52 +08:00
parent 98fc6d9e3d
commit 964f960264
2 changed files with 8 additions and 6 deletions
@@ -195,7 +195,8 @@ class SplitRedirectService
$keys = array_keys($groups);
if (count($keys) === 1) {
return $keys[0];
// PHP 会把纯数字字符串键转成 int,需强转以匹配 ?string 返回类型
return (string) $keys[0];
}
$r = random_int(1, $total);
@@ -203,11 +204,11 @@ class SplitRedirectService
foreach ($groups as $key => $rows) {
$acc += count($rows);
if ($r <= $acc) {
return $key;
return (string) $key;
}
}
return $keys[0];
return (string) $keys[0];
}
/**
@@ -195,7 +195,8 @@ class SplitRedirectService
$keys = array_keys($groups);
if (count($keys) === 1) {
return $keys[0];
// PHP 会把纯数字字符串键转成 int,需强转以匹配 ?string 返回类型
return (string) $keys[0];
}
$r = random_int(1, $total);
@@ -203,11 +204,11 @@ class SplitRedirectService
foreach ($groups as $key => $rows) {
$acc += count($rows);
if ($r <= $acc) {
return $key;
return (string) $key;
}
}
return $keys[0];
return (string) $keys[0];
}
/**