tongshanglei 2 years ago
parent
commit
f7270b48b7
1 changed files with 7 additions and 1 deletions
  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){
     public function getIsOnlineAttr($value){
-        return 1;
+        $value = strtotime($this->online_time);
+        $int=time()-$value;
+        if($int>120){
+            return '0';
+        }else{
+            return '1';
+        }
     }
     }
  
  
 }
 }