|
@@ -28,18 +28,8 @@ class BeanRepository
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public function getBean($request)
|
|
|
- {
|
|
|
- $user_bean = [];
|
|
|
- $user_bean['user_count'] = Redis::get('user_count');//已入驻居民
|
|
|
- $user_bean['yesterday_add_user'] = Redis::get('yesterday_add_user');//昨日新增居民
|
|
|
- $user_bean['yesterday_add_bean'] = Redis::get('yesterday_add_bean');//昨日发放彩虹豆
|
|
|
- $user_bean['yesterday_quantity_issued'] = Redis::get('yesterday_quantity_issued');//昨日发放总彩虹豆
|
|
|
-
|
|
|
- return $user_bean;
|
|
|
- }
|
|
|
-
|
|
|
- public function excellentResidents($request)
|
|
|
+ //获取优秀居民信息
|
|
|
+ function excellentResidents($request)
|
|
|
{
|
|
|
// $get_excellent = Redis::get('yesterday_excellent_residents');
|
|
|
// $excellent_residents = json_decode($get_excellent);
|
|
@@ -272,4 +262,57 @@ class BeanRepository
|
|
|
|
|
|
}
|
|
|
|
|
|
+ public function starHome($request)
|
|
|
+ {
|
|
|
+ $star_home['star'] = [];
|
|
|
+ $my_bean = [];
|
|
|
+ $star_home['star'][0]['mybean'] = $my_bean;
|
|
|
+// $star_home['star'][0]['mybean']['user_all_bean'] = Redis::get('user_all_bean');//用户总彩虹豆
|
|
|
+ $star_home['star'][0]['mybean']['user_all_bean'] = 0;//用户总彩虹豆
|
|
|
+// $star_home['star'][0]['yesterday_add_bean'] = Redis::get('yesterday_add_bean');//昨日发放彩虹豆
|
|
|
+ $star_home['star'][0]['mybean']['yesterday_add_bean'] = 3;//昨日新增彩虹豆
|
|
|
+// $star_home['star'][0]['user_count'] = Redis::get('user_count');//已入驻居民
|
|
|
+ $star_home['star'][0]['mybean']['user_count'] = 1;//已入驻居民
|
|
|
+// $star_home['star'][0]['yesterday_add_user'] = Redis::get('yesterday_add_user');//昨日新增居民
|
|
|
+ $star_home['star'][0]['mybean']['yesterday_add_user'] = 2;//昨日新增居民
|
|
|
+// $star_home['star'][0]['yesterday_quantity_issued'] = Redis::get('yesterday_quantity_issued');//昨日发放总彩虹豆
|
|
|
+ $star_home['star'][0]['mybean']['yesterday_quantity_issued'] = 4;//昨日发放总彩虹豆
|
|
|
+
|
|
|
+ $star_home['star'][1]['excellent_residents'] = $this->excellentResidents($request);
|
|
|
+ $star_home['star'][2]['daily_news'] = $this->getNews($request);
|
|
|
+ $star_home['star'][3]['tips'] = $this->getPlatformContent($id = 1);
|
|
|
+
|
|
|
+ return $star_home;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ //获取每日新闻
|
|
|
+ function getNews($request) {
|
|
|
+ try {
|
|
|
+ $url = config("customer.app_service_url").'/config/v2/starNews/lists';
|
|
|
+ $array = [
|
|
|
+ 'json' => [], 'query' => [], 'http_errors' => false,'headers'=>['Authorization'=>"Bearer ".JWTAuth::getToken()]
|
|
|
+ ];
|
|
|
+ return http($url,$array,'get');
|
|
|
+ } catch (\Exception $e) {
|
|
|
+ Log::debug($e->getMessage());
|
|
|
+ return [];
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ //获取平台内容
|
|
|
+ function getPlatformContent($id) {
|
|
|
+ try {
|
|
|
+ $url = config("customer.app_service_url").'/config/v2/platformContent/lists';
|
|
|
+ $array = [
|
|
|
+ 'json' => ['id'=>$id], 'query' => [], 'http_errors' => false,'headers'=>['Authorization'=>"Bearer ".JWTAuth::getToken()]
|
|
|
+ ];
|
|
|
+ return http($url,$array,'get');
|
|
|
+ } catch (\Exception $e) {
|
|
|
+ Log::debug($e->getMessage());
|
|
|
+ return [];
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
}
|