From f7a586b7d9096d1f057eb447e6fbb8294a74a084 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B7=B4=E6=8E=8C?= Date: Wed, 28 Oct 2020 22:54:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=AD=E4=BD=8D=E6=95=B0?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/chengji/model/Tongji.php | 6 +++--- public/.htaccess | 12 ++++++------ public/nginx.htaccess | 0 3 files changed, 9 insertions(+), 9 deletions(-) create mode 100644 public/nginx.htaccess diff --git a/app/chengji/model/Tongji.php b/app/chengji/model/Tongji.php index a1d6c18e..43dd2196 100644 --- a/app/chengji/model/Tongji.php +++ b/app/chengji/model/Tongji.php @@ -246,15 +246,15 @@ class Tongji extends BaseModel $zws = 0; $cnt = count($arr); - if ($cnt = 1) { + if ($cnt === 1) { $zws = $arr[0]; }elseif ($cnt > 1) { $mod = $cnt % 2; - if ($mod == 0) { + if ($mod === 0) { $i = $cnt / 2; $zws = ($arr[$i] + $arr[$i + 1]) / 2; }else{ - $i = ($cnt + 1) / 2; + $i = ($cnt - 1) / 2; $zws = $arr[$i]; } }else{ diff --git a/public/.htaccess b/public/.htaccess index d9ee23c9..3916a08b 100644 --- a/public/.htaccess +++ b/public/.htaccess @@ -1,8 +1,8 @@ - Options +FollowSymlinks -Multiviews - RewriteEngine On +Options +FollowSymlinks -Multiviews +RewriteEngine On - RewriteCond %{REQUEST_FILENAME} !-d - RewriteCond %{REQUEST_FILENAME} !-f - RewriteRule ^(.*)$ index.php?/$1 [QSA,PT,L] - +RewriteCond %{REQUEST_FILENAME} !-d +RewriteCond %{REQUEST_FILENAME} !-f +RewriteRule ^(.*)$ index.php?/$1 [QSA,PT,L] + \ No newline at end of file diff --git a/public/nginx.htaccess b/public/nginx.htaccess new file mode 100644 index 00000000..e69de29b