Quellcode durchsuchen

Merge branch 'develop' of http://git.caihongxingqiu.net/rainbow/community-service into develop

xielin vor 5 Jahren
Ursprung
Commit
48bf04bde9
2 geänderte Dateien mit 25 neuen und 0 gelöschten Zeilen
  1. 24 0
      app/Repositories/BeanRepository.php
  2. 1 0
      config/customer.tpl

+ 24 - 0
app/Repositories/BeanRepository.php

@@ -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;
     }
 

+ 1 - 0
config/customer.tpl

@@ -10,4 +10,5 @@ return [
     'category_hot_img' => '{category_hot_img}',
     'category_my_img' => '{category_my_img}',
     'battle_activity_info' => '{battle_activity_info}',
+    'exchange_shop_is_show' => '{exchange_shop_is_show}',
 ];