This commit is contained in:
hellcat 2025-03-25 21:05:54 +08:00
parent 0234781931
commit 881b82316c

View File

@ -160,14 +160,22 @@ final class HookController
}
// 节点一览
if (strpos($sText, '/nodeAll') === 0) {
// 节点搜索
if (strpos($sText, '/nodeLike_') === 0) {
$aNodeAll = Node::orderBy("name")->get()->toArray();
list($sCmd, $sLike) = explode(" ", $sText, 2);
list(, $sField) = explode("_", $sCmd, 2);
if ($sField == "port") {
$sField = "custom_config";
}
$aNodeList = Node::where($sField, "like", "%".$sLike."%")->get()->toArray();
$sMsg = '';
foreach ($aNodeAll as $row) {
foreach ($aNodeList as $row) {
$sMsg .= "\n\n";
$sMsg .= "名字:".$row['name']."\n";
$sMsg .= "转发:".$row['zhuanfa_code']."\n";