|
@@ -242,6 +242,7 @@ class BeanRepository
|
|
|
}
|
|
|
}
|
|
|
$star_home['chatroom'] = $chatrooms;
|
|
|
+ $star_home['is_show'] = intval(config('customer.exchange_shop_is_show'));
|
|
|
|
|
|
return $star_home;
|
|
|
|
|
@@ -410,6 +411,29 @@ class BeanRepository
|
|
|
$star_lists['daily_news'] = $this->getNews($request);
|
|
|
$star_lists['tips'] = $this->getPlatformContent($id = 1);
|
|
|
|
|
|
+ //聊天室
|
|
|
+ $tmpChatroom = Redis::get('user_service_chatroom');
|
|
|
+ $chatrooms = $tmpChatroom?json_decode($tmpChatroom,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['is_open'] = 0;
|
|
|
+ } else {
|
|
|
+ $chatroom['is_open'] = 1;
|
|
|
+ }
|
|
|
+ } elseif ($chatroom['start']>$chatroom['end']) {
|
|
|
+ if ($current<$chatroom['end']) {
|
|
|
+ $chatroom['is_open'] = 0;
|
|
|
+ } else {
|
|
|
+ $chatroom['is_open'] = 1;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ $chatroom['is_open'] = 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $star_lists['chatroom'] = $chatrooms;
|
|
|
+
|
|
|
return $star_lists;
|
|
|
}
|
|
|
|