|
@@ -135,12 +135,18 @@ class Station extends Model
|
|
|
|
|
|
if($value=='1'){
|
|
|
if(!$config){
|
|
|
- return $query->where('online_state', 1)->whereOr('online_state','null')->whereOr('online_state','');
|
|
|
+ return $query->where(function ($query) use( $time) {
|
|
|
+ $query->where('online_state', 1)->whereOr('online_state','null')->whereOr('online_state','');
|
|
|
+ });
|
|
|
}
|
|
|
- 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'){
|
|
|
if(!$config){
|
|
|
- return $query->where('online_state',2);
|
|
|
+ return $query->where(function ($query) use( $time) {
|
|
|
+ $query->where('online_state',2);
|
|
|
+ });
|
|
|
}
|
|
|
return $query->where(function ($query) use( $time) {
|
|
|
$query->whereOr('online_time','<', $time)->whereOr('online_time','=', null);
|