This commit is contained in:
hellcat 2025-03-14 22:31:40 +08:00
parent afad033358
commit 5a512986f7
3 changed files with 12 additions and 7 deletions

View File

@ -483,7 +483,7 @@ final class Cron
// 流量报告,机器
$oTgSendFormat = new TgSendFormat();
$oTgSendFormat->sTitleEmoji = "⚡️⚡️⚡️⚡️⚡️⚡️";
$oTgSendFormat->sTitleEmoji = "";
$oTgSendFormat->sTitle = "流量报告 - 机器";
$oDucksAll = $oDucks->all();

View File

@ -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];

View File

@ -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
{