no message

This commit is contained in:
hellcat 2026-04-29 18:43:06 +08:00
parent a864d6aede
commit 3684deca46
2 changed files with 57 additions and 1 deletions

View File

@ -1667,7 +1667,6 @@ final class Cron
$sTgReport = $oTgSendFormat->typeA();
(new Telegram())->send(0, $sTgReport);
}
// public static function mergeBandWidth__old(): void

View File

@ -36,6 +36,63 @@ class Node extends Base {
}
public function portModifyDone($aParam)
{
$aParam["bDone"] = true;
return $this->portModify($aParam);
}
public function portModify($aParam)
{
$sPortType = $aParam["aOption"][1] ?? 'node';
$sPortLike = $aParam["aOption"][2] ?? 0;
$sPortSet = $aParam["aArg"][1] ?? 0;
$bDone = $aParam["bDone"] ?? false;
if (!$sPortLike || !$sPortSet) {
return "缺少参数";
}
if ($sPortSet == "?") {
return "__[portType:node]__[portLike] [portSet]";
}
if ($sPortType == 'node') {
$sPortName = "offset_port_node";
} else if ($sPortType = 'user') {
$sPortName = "offset_port_user";
} else {
return "protyType非法";
}
$oNodes = ModelNode::where("custom_config", "like", "%{$sPortLike}%")
->get()
->filter(function ($oNode) use ($sPortName) {
$aCustomConfig = json_decode($oNode->custom_config, true);
return isset($aCustomConfig[$sPortName]);
});
$iCount = $oNodes->count();
if (!$bDone) {
$s = "匹配一下数据,{$iCount}条。确认加done。 \n\n";
$s .= $this->toJson($oNodes->toArray());
return $s;
}
$i = 0;
foreach ($oNodes as $oNode) {
$aCustomConfig = json_decode($oNode->custom_config, true);
$aCustomConfig[$sPortName] = $sPortSet;
$jCustomConfig = json_encode($aCustomConfig);
$oNode->custom_config = $jCustomConfig;
$i += $oNode->save();
}
return "完成,处理{$i}条。";
}
public function fly($aParam)
{
// $sCmd = $aParam["cmd"] ?? "";