no message
This commit is contained in:
parent
593d1ae525
commit
25972ba0a4
35
resources/email/tip.tpl
Executable file
35
resources/email/tip.tpl
Executable file
@ -0,0 +1,35 @@
|
||||
{include file='header.tpl'}
|
||||
|
||||
<body style="background-color:#EEEEEE;">
|
||||
<div style="text-align: center">
|
||||
<div border="0" cellpadding="0" cellspacing="0" width="100%"
|
||||
style="padding-top:30px;table-layout:fixed;background-color:#EEEEEE;" id="bodyTable">
|
||||
<div align="center" valign="top" style="padding-right:10px;padding-left:10px;" id="bodyCell">
|
||||
<div border="0" cellpadding="0" cellspacing="0"
|
||||
style="background-color:#FFFFFF;max-width:600px;text-align: center" width="100%" class="wrapperTable">
|
||||
<div align="center" valign="top">
|
||||
<div border="0" cellpadding="0" cellspacing="0" width="100%" class="logoTable">
|
||||
<div align="center" valign="middle" style="padding-top:60px;padding-bottom:60px">
|
||||
<h2 class="bigTitle">
|
||||
运维通知
|
||||
</h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div border="0" cellpadding="0" cellspacing="0" style="max-width:600px;text-align: center" width="100%"
|
||||
class="wrapperTable">
|
||||
<div align="center" valign="top">
|
||||
<div border="0" cellpadding="0" cellspacing="0" style="background-color:#FFFFFF" width="100%"
|
||||
class="oneColumn">
|
||||
<div align="center" valign="top"
|
||||
style="padding-bottom:60px;padding-left:20px;padding-right:20px;" class="description">
|
||||
<p class="midText">
|
||||
{$text}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{include file='footer.tpl'}
|
||||
@ -15,6 +15,10 @@ final class Buchang
|
||||
$sType = $aParam["aOption"][1] ?? 2; // 1是试用套餐,付费是>=2
|
||||
$sValue = $aParam["aArg"][1] ?? false;
|
||||
|
||||
if ($sValue == "?") {
|
||||
return "/buchang#buchang <gb> | 默认补偿有套餐用户(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;
|
||||
//
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -28,11 +28,22 @@ use Smarty\Smarty;
|
||||
final class Mail
|
||||
{
|
||||
|
||||
public function mod1($aParam)
|
||||
{
|
||||
// $sValue = $aParam["aArg"][1] ?? false;
|
||||
//
|
||||
// if ($sValue == "?") {
|
||||
// return "/mail#mod1 <liuliang>";
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
public function tmp()
|
||||
{
|
||||
$subject = "福云 - 重要通知:域名地址变更!";
|
||||
$subject = "福云 - 运维通知";
|
||||
|
||||
$text = "<br>原主域名fuuu.cloud被封禁,已更换为fuuuu.cloud(多了一个u)。<br><br>无法继续翻墙的用户需到网站上重新复制订阅。<br><br>很抱歉对您的使用造成影响,补偿有套餐用户30g流量。";
|
||||
// $text = "<br>原主域名fuuu.cloud被封禁,已更换为fuuuu.cloud(多了一个u)。<br><br>无法继续翻墙的用户需到网站上重新复制订阅。<br><br>很抱歉对您的使用造成影响,补偿有套餐用户30g流量。";
|
||||
$text = "<br>近期管控收紧,造成节点波动和不可用。已陆续恢复正常,补偿有套餐用户10g流量。<br><br>最新域名: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) {
|
||||
|
||||
@ -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 "<pre>";
|
||||
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 "<pre>";
|
||||
// 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);
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user