lizhen_gitee il y a 10 mois
Parent
commit
7098117168
2 fichiers modifiés avec 8 ajouts et 2 suppressions
  1. 6 0
      application/api/controller/Demo.php
  2. 2 2
      application/common.php

+ 6 - 0
application/api/controller/Demo.php

@@ -90,4 +90,10 @@ class Demo extends Api
         dump(format_bytes($a));
     }
 
+    public function test4(){
+        $a = time() - 20;
+        dump($a);
+        dump(get_last_time($a));
+    }
+
 }

+ 2 - 2
application/common.php

@@ -635,9 +635,9 @@ if (!function_exists('get_last_time')) {
         $t = $nowtime - $time; //时间差 (秒)
         $y = date('Y', $time)-date('Y', $nowtime);//是否跨年
         switch($t){
-            case $t = 0:
+            /*case $t = 0:
                 $text = '刚刚';
-                break;
+                break;*/
             case $t < 60:
                 $text = $t . '秒前'; // 一分钟内
                 break;