tongshanglei hace 2 años
padre
commit
f7270b48b7
Se han modificado 1 ficheros con 7 adiciones y 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';
+        }
     }
  
 }