diff --git a/resources/email/tip.tpl b/resources/email/tip.tpl new file mode 100755 index 00000000..91ae55cd --- /dev/null +++ b/resources/email/tip.tpl @@ -0,0 +1,35 @@ +{include file='header.tpl'} + + +
+
+
+
+
+
+
+

+ 运维通知 +

+
+
+
+
+
+
+
+
+

+ {$text} +

+
+
+
+
+ + {include file='footer.tpl'} diff --git a/src/Services/Tg/Hook/Mod/Buchang.php b/src/Services/Tg/Hook/Mod/Buchang.php index 2f2432bb..b48a1798 100644 --- a/src/Services/Tg/Hook/Mod/Buchang.php +++ b/src/Services/Tg/Hook/Mod/Buchang.php @@ -15,6 +15,10 @@ final class Buchang $sType = $aParam["aOption"][1] ?? 2; // 1是试用套餐,付费是>=2 $sValue = $aParam["aArg"][1] ?? false; + if ($sValue == "?") { + return "/buchang#buchang | 默认补偿有套餐用户(class>2),可设为1"; + } + if (!$sValue) { return "需要value"; } @@ -39,24 +43,24 @@ final class Buchang - public function Find($aParam) - { - -// list($sCmd, $sCode) = explode(" ", $sText, 2); - - $sCode = $aParam['aArg'][1]; - - $aData = ModelDuck::where('code', $sCode)->first()->toArray(); - - $aData['use_width'] = Tools::flowToGB($aData['use_width']).'GB'; - $aData['max_width'] = Tools::flowToGB($aData['max_width']).'GB'; - $aData['today_width'] = Tools::flowToGB($aData['today_width']).'GB'; - - $sMsg = json_encode($aData, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT); - - return $sMsg; - - } +// public function Find($aParam) +// { +// +//// list($sCmd, $sCode) = explode(" ", $sText, 2); +// +// $sCode = $aParam['aArg'][1]; +// +// $aData = ModelDuck::where('code', $sCode)->first()->toArray(); +// +// $aData['use_width'] = Tools::flowToGB($aData['use_width']).'GB'; +// $aData['max_width'] = Tools::flowToGB($aData['max_width']).'GB'; +// $aData['today_width'] = Tools::flowToGB($aData['today_width']).'GB'; +// +// $sMsg = json_encode($aData, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT); +// +// return $sMsg; +// +// } } diff --git a/src/Services/Tg/Hook/Mod/Mail.php b/src/Services/Tg/Hook/Mod/Mail.php index 63a76b34..ad079780 100644 --- a/src/Services/Tg/Hook/Mod/Mail.php +++ b/src/Services/Tg/Hook/Mod/Mail.php @@ -28,11 +28,22 @@ use Smarty\Smarty; final class Mail { + public function mod1($aParam) + { +// $sValue = $aParam["aArg"][1] ?? false; +// +// if ($sValue == "?") { +// return "/mail#mod1 "; +// } + + } + public function tmp() { - $subject = "福云 - 重要通知:域名地址变更!"; + $subject = "福云 - 运维通知"; - $text = "
原主域名fuuu.cloud被封禁,已更换为fuuuu.cloud(多了一个u)。

无法继续翻墙的用户需到网站上重新复制订阅。

很抱歉对您的使用造成影响,补偿有套餐用户30g流量。"; +// $text = "
原主域名fuuu.cloud被封禁,已更换为fuuuu.cloud(多了一个u)。

无法继续翻墙的用户需到网站上重新复制订阅。

很抱歉对您的使用造成影响,补偿有套餐用户30g流量。"; + $text = "
近期管控收紧,造成节点波动和不可用。已陆续恢复正常,补偿有套餐用户10g流量。

最新域名:fuuuu.cloud"; $content = strip_tags( str_replace( @@ -44,7 +55,7 @@ final class Mail ); $users = (new User())->where('class', '>=', 0)->get(); -// $users = (new User())->where("email", "yuejiqi@tuta.io")->get(); + $users = (new User())->where("email", "yuejiqi@tuta.io")->get(); $i = 0; foreach ($users as $user) { diff --git a/src/Services/Tg/Http.php b/src/Services/Tg/Http.php index 79207a59..328d81d3 100644 --- a/src/Services/Tg/Http.php +++ b/src/Services/Tg/Http.php @@ -15,20 +15,34 @@ class Http { // $this->sApiChatId = Config::obtain('telegram_chatid'); } - public function sendToTG($sMsg = "没有msg?") + public function sendToTG($sMsg = "没有msg?", $aUpdate = []) { - if ($_ENV['is_loc'] === true) { - echo "
";
-            echo($sMsg);
+        if (isset($aUpdate["cmd"]) && $aUpdate["cmd"] == "shell") {
+            
+            echo $sMsg;
+            
+        } else if (isset($aUpdate["is_dove"]) && $aUpdate["is_dove"] == true) {
+            
+            echo $sMsg;
+            
         } else {
             
             (new Telegram())->send(0, $sMsg);
             
-//            $url = "https://api.telegram.org/bot$this->sApiToken/sendMessage?chat_id=$this->sApiChatId&text=" . urlencode($sMsg);
-//            file_get_contents($url);
         }
         
+//        if ($_ENV['is_loc'] === true) {
+//            echo "
";
+//            echo($sMsg);
+//        } else {
+//            
+//            (new Telegram())->send(0, $sMsg);
+//            
+////            $url = "https://api.telegram.org/bot$this->sApiToken/sendMessage?chat_id=$this->sApiChatId&text=" . urlencode($sMsg);
+////            file_get_contents($url);
+//        }
+        
     }
     
 }