|
@@ -221,7 +221,26 @@ class BeanRepository
|
|
|
$star_home['battle']['news'] = Redis::get('battle_latest_info_'.$activityInfo['id'])??'战场四平八稳,劳驾老板亲自去战场督战';
|
|
|
|
|
|
//聊天室
|
|
|
- $star_home['chatroom'] = json_decode(Redis::get('user_service_chatroom'),true)??[];
|
|
|
+ $chatrooms = json_decode(Redis::get('user_service_chatroom'),true)??[];
|
|
|
+ $current = Carbon::now()->format('H:i:s');
|
|
|
+ foreach ($chatrooms as &$chatroom) {
|
|
|
+ if ($chatroom['start']<$chatroom['end']) {
|
|
|
+ if ($current<$chatroom['start'] || $current>$chatroom['end']) {
|
|
|
+ $chatroom['id_open'] = 0;
|
|
|
+ } else {
|
|
|
+ $chatroom['id_open'] = 1;
|
|
|
+ }
|
|
|
+ } elseif ($chatroom['start']>$chatroom['end']) {
|
|
|
+ if ($current<$chatroom['end']) {
|
|
|
+ $chatroom['id_open'] = 0;
|
|
|
+ } else {
|
|
|
+ $chatroom['id_open'] = 1;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ $chatroom['id_open'] = 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $star_home['chatroom'] = $chatrooms;
|
|
|
|
|
|
return $star_home;
|
|
|
|