diff --git a/src/Services/Cron.php b/src/Services/Cron.php index 650162ce..549c9acc 100755 --- a/src/Services/Cron.php +++ b/src/Services/Cron.php @@ -483,7 +483,7 @@ final class Cron // 流量报告,机器 $oTgSendFormat = new TgSendFormat(); - $oTgSendFormat->sTitleEmoji = "⚡️⚡️⚡️⚡️⚡️⚡️"; + $oTgSendFormat->sTitleEmoji = ""; $oTgSendFormat->sTitle = "流量报告 - 机器"; $oDucksAll = $oDucks->all(); diff --git a/src/Services/TomTool/TgSendFormat.php b/src/Services/TomTool/TgSendFormat.php index 58c203a4..d4c85b5d 100755 --- a/src/Services/TomTool/TgSendFormat.php +++ b/src/Services/TomTool/TgSendFormat.php @@ -17,7 +17,7 @@ final class TgSendFormat { $sStr = ''; - $sStr .= "\n\n".$this->sTitleEmoji; + $sStr .= " \n".$this->sTitleEmoji; $sStr .= "\n\n".$this->sTitle; @@ -32,8 +32,8 @@ final class TgSendFormat public function rowAdd($sName, $iFlowToday, $iUseWidth, $iMaxWidth, $iLimitDay = false) { - $iUseWidth = number_format(Tools::flowToGB($iUseWidth) / 1024, 2); - $iMaxWidth = number_format(Tools::flowToGB($iMaxWidth) / 1024, 2); + $iUseWidth = Tools::flowToTB($iUseWidth); + $iMaxWidth = Tools::flowToTB($iMaxWidth); $iFlowToday = Tools::flowToGB($iFlowToday); if ($iMaxWidth <= 0) { @@ -48,13 +48,13 @@ final class TgSendFormat $sFlowEmoji = '🔋'; } - $sFlowMix = $sFlowEmoji.' '.(100 - $sFlowRate)."%(".$iMaxWidth." - ".$iUseWidth." = ".$iMaxWidth - $iUseWidth.")【 消耗:".$iFlowToday."g"; + $sFlowMix = $sFlowEmoji.' '.(100 - $sFlowRate)."%(".$iMaxWidth." - ".$iUseWidth." = ".$iMaxWidth - $iUseWidth.")【 消耗:".$iFlowToday."g 】"; if ($iLimitDay > 0) { - $sFlowMix .= ",距离重置:".$iLimitDay." 天"; + $sFlowMix .= "【 距离重置:".$iLimitDay." 天 】"; } - $sFlowMix .= " 】"; +// $sFlowMix .= " 】"; $this->aContent[] = [$sName, $sFlowMix]; diff --git a/src/Utils/Tools.php b/src/Utils/Tools.php index 911ebdc8..4df48858 100755 --- a/src/Utils/Tools.php +++ b/src/Utils/Tools.php @@ -168,6 +168,11 @@ final class Tools { return round($traffic / 1073741824, 2); } + + public static function flowToTB($traffic): float + { + return round($traffic / 1099511627776, 2); + } public static function genSubToken(): string {