all(); foreach ($list as $item) { // UserSn::where('user_sn', $item->sn)->update(['user_id' => $item->id]); } return self::SUCCESS; } } function replaceRichTextUrls($input) { // 匹配旧域名及其引号包裹情况(包含http/https协议) $pattern = '#(https?://server\.xyh\.hnzhwlkj\.club|["\']https?://server\.xyh\.hnzhwlkj\.club)(/[^\s"\'<>]*)?#iu'; $replacement = function ($matches) { $originalQuote = ''; $path = $matches[2] ?? ''; // 检测是否以引号开头 if (isset($matches[0][0]) && in_array($matches[0][0], ['"', "'"])) { $originalQuote = $matches[0][0]; } // 构建新URL(强制使用http协议) return $originalQuote . 'http://219.157.255.213:25326' . $path; }; return preg_replace_callback($pattern, $replacement, $input); }