tongshanglei %!s(int64=2) %!d(string=hai) anos
pai
achega
f7270b48b7
Modificáronse 1 ficheiros con 7 adicións e 1 borrados
  1. 7 1
      catch/device/model/get/StationGet.php

+ 7 - 1
catch/device/model/get/StationGet.php

@@ -21,7 +21,13 @@ trait StationGet
         }
     }
     public function getIsOnlineAttr($value){
-        return 1;
+        $value = strtotime($this->online_time);
+        $int=time()-$value;
+        if($int>120){
+            return '0';
+        }else{
+            return '1';
+        }
     }
  
 }