diff --git a/src/Controllers/TomApi/Tg/HookController.php b/src/Controllers/TomApi/Tg/HookController.php index b0c2de89..3eb830e1 100755 --- a/src/Controllers/TomApi/Tg/HookController.php +++ b/src/Controllers/TomApi/Tg/HookController.php @@ -34,7 +34,7 @@ final class HookController public function cmd() { - Http::response(200, 'ok'); +// Http::response(200, 'ok'); try { $oTGHttp = new TGHttp(); diff --git a/src/Services/Tg/Hook/Mod/Base.php b/src/Services/Tg/Hook/Mod/Base.php index 81c0eda0..f557bed2 100644 --- a/src/Services/Tg/Hook/Mod/Base.php +++ b/src/Services/Tg/Hook/Mod/Base.php @@ -15,6 +15,11 @@ class Base { $this->oTGHttp = new TGHttp(); } + public function toJson($sMsg) + { + return json_encode($row, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT); + } + // protected function cmdGood($sCmd) { // // $sCmdNew = ""; diff --git a/src/Services/Tg/Hook/Mod/Node.php b/src/Services/Tg/Hook/Mod/Node.php index 69ef29d0..1e34592b 100644 --- a/src/Services/Tg/Hook/Mod/Node.php +++ b/src/Services/Tg/Hook/Mod/Node.php @@ -114,7 +114,7 @@ class Node extends Base } else { $aNodeListNew = []; - foreach ($aNodeList as $row) { + foreach ($aNodeList as &$row) { $row['custom_config'] = json_decode($row['custom_config']); $row['dynamic_rate_config'] = json_decode($row['dynamic_rate_config']); @@ -128,14 +128,15 @@ class Node extends Base unset($row['is_dynamic_rate']); unset($row['password']); - $sMsg = json_encode($row, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT); - - $this->oTGHttp->sendToTG($sMsg); - +// $sMsg = json_encode($row, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT); +// +// $this->oTGHttp->sendToTG($sMsg); +// } - + $sMsg = $this->toJson($aNodeList); } - $this->oHttp::response(200, 'ok'); + return $sMsg; +// $this->oHttp::response(200, 'ok'); } public function FindSet($aParam)