tongshanglei 2 years ago
parent
commit
41a6f6c3c6
1 changed files with 3 additions and 2 deletions
  1. 3 2
      catch/device/model/Station.php

+ 3 - 2
catch/device/model/Station.php

@@ -54,7 +54,6 @@ class Station extends Model
                 $item['longitude']=$wgsLoc['lng'];
                 $item['latitude']=$wgsLoc['lat'];
             });
-            
         return $res;
     }
 
@@ -131,7 +130,9 @@ class Station extends Model
     {
         $time=date('Y-m-d H:i:s',time()-300);
         if($value=='1'){
-            return $query->where('online_time', '>=', $time)->whereOr('online_state','=', 1);
+            return $query->where(function ($query) use($time) {
+                $query->where('online_time', '>=', $time)->whereOr('online_state','=', 1);
+             });
         }elseif($value=='2'){
             return $query->where(function ($query) use( $time) {
                 $query->whereOr('online_time','<', $time)->whereOr('online_time','=', null);