From b5cde5047fb58b96bafcae106f8c439d4895c3b9 Mon Sep 17 00:00:00 2001 From: tongyifan <565813476@qq.com> Date: Thu, 11 Jul 2019 09:12:26 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E7=AB=99=E7=82=B9=E6=95=B0=E6=8D=AE):=20?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=96=AD=E7=A7=8D=E7=8E=87=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/index.php b/index.php index ae154d1..3c2b90f 100644 --- a/index.php +++ b/index.php @@ -509,6 +509,11 @@ function srt($a, $b) $Cache->add_whole_row(); $torrents = number_format(get_row_count("torrents")); $dead = number_format(get_row_count("torrents", "WHERE visible='no'")); + if ($torrents == 0) { + $dead_rate = 0; + } else { + $dead_rate = round($dead / $torrents * 100, 1); + } $seeders = get_row_count("peers", "WHERE seeder='yes'"); $leechers = get_row_count("peers", "WHERE seeder='no'"); if ($leechers == 0) @@ -532,7 +537,7 @@ function srt($a, $b)