no message
This commit is contained in:
parent
a864d6aede
commit
3684deca46
@ -1667,7 +1667,6 @@ final class Cron
|
|||||||
$sTgReport = $oTgSendFormat->typeA();
|
$sTgReport = $oTgSendFormat->typeA();
|
||||||
|
|
||||||
(new Telegram())->send(0, $sTgReport);
|
(new Telegram())->send(0, $sTgReport);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// public static function mergeBandWidth__old(): void
|
// public static function mergeBandWidth__old(): void
|
||||||
|
|||||||
@ -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)
|
public function fly($aParam)
|
||||||
{
|
{
|
||||||
// $sCmd = $aParam["cmd"] ?? "";
|
// $sCmd = $aParam["cmd"] ?? "";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user