|
@@ -424,24 +424,31 @@ class BeanRepository
|
|
$tmpChatroom = Redis::get('user_service_chatroom');
|
|
$tmpChatroom = Redis::get('user_service_chatroom');
|
|
$chatrooms = $tmpChatroom?json_decode($tmpChatroom,true):[];
|
|
$chatrooms = $tmpChatroom?json_decode($tmpChatroom,true):[];
|
|
$current = Carbon::now()->format('H:i:s');
|
|
$current = Carbon::now()->format('H:i:s');
|
|
|
|
+ $chatRoomsData1 = [];
|
|
|
|
+ $chatRoomsData0 = [];
|
|
foreach ($chatrooms as &$chatroom) {
|
|
foreach ($chatrooms as &$chatroom) {
|
|
if ($chatroom['start']<$chatroom['end']) {
|
|
if ($chatroom['start']<$chatroom['end']) {
|
|
if ($current<$chatroom['start'] || $current>$chatroom['end']) {
|
|
if ($current<$chatroom['start'] || $current>$chatroom['end']) {
|
|
$chatroom['is_open'] = 0;
|
|
$chatroom['is_open'] = 0;
|
|
|
|
+ $chatRoomsData0[] = $chatroom;
|
|
} else {
|
|
} else {
|
|
$chatroom['is_open'] = 1;
|
|
$chatroom['is_open'] = 1;
|
|
|
|
+ $chatRoomsData1[] = $chatroom;
|
|
}
|
|
}
|
|
} elseif ($chatroom['start']>$chatroom['end']) {
|
|
} elseif ($chatroom['start']>$chatroom['end']) {
|
|
if ($current>$chatroom['end'] && $current<$chatroom['start']) {
|
|
if ($current>$chatroom['end'] && $current<$chatroom['start']) {
|
|
$chatroom['is_open'] = 0;
|
|
$chatroom['is_open'] = 0;
|
|
|
|
+ $chatRoomsData0[] = $chatroom;
|
|
} else {
|
|
} else {
|
|
$chatroom['is_open'] = 1;
|
|
$chatroom['is_open'] = 1;
|
|
|
|
+ $chatRoomsData1[] = $chatroom;
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
$chatroom['is_open'] = 1;
|
|
$chatroom['is_open'] = 1;
|
|
|
|
+ $chatRoomsData1[] = $chatroom;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- $star_lists['chatroom'] = $chatrooms;
|
|
|
|
|
|
+ $star_lists['chatroom'] = array_merge($chatRoomsData1, $chatRoomsData0);
|
|
|
|
|
|
return $star_lists;
|
|
return $star_lists;
|
|
}
|
|
}
|