Kaynağa Gözat

Merge branch 'master' into release

xielin 5 yıl önce
ebeveyn
işleme
07acb86e23

+ 1 - 1
app/Console/Kernel.php

@@ -41,7 +41,7 @@ class Kernel extends ConsoleKernel
     {
         $path = storage_path('logs/' . date('Y-m-d') . '-schedule.log');
         $schedule->command('post:calc_weight')
-            ->everyFifteenMinutes()->withoutOverlapping()->appendOutputTo($path);
+            ->everyFiveMinutes()->withoutOverlapping()->appendOutputTo($path);
         $schedule->command('excellent:residents')
             ->dailyAt('00:05')
             ->withoutOverlapping()->appendOutputTo($path);

+ 9 - 0
app/Http/Controllers/V1/PostController.php

@@ -508,4 +508,13 @@ class PostController extends Controller
         return jsonSuccess($res);
     }
 
+    /**
+     * 下载量
+     */
+    public function downloadCount()
+    {
+        Redis::INCRBY('app_h5_download_count', 1);
+        return jsonSuccess();
+    }
+
 }

+ 38 - 0
app/Repositories/BeanRepository.php

@@ -167,6 +167,8 @@ class BeanRepository
         $uid = $token['user']->uid;
         $bean = Redis::ZSCORE('user_rainbow_bean'.$today,$uid);
 
+        $userInfo = $this->userInfo($uid);
+
         $star_home = [];
         $user_bean = Redis::get('my_bean');
         Log::debug($user_bean);
@@ -186,6 +188,27 @@ class BeanRepository
         $star_home['daily_news'] = $this->getNews($request);
         $star_home['tips'] = $this->getPlatformContent($id = 1);
 
+        $backyard = $this->backyard($uid);
+
+        $star_home['backyard']['backyard_imgs'] = [
+            "http://oss.caihongxingqiu.com/h5/planet/cover_01.png",
+            "http://oss.caihongxingqiu.com/h5/planet/cover_02.png",
+            "http://oss.caihongxingqiu.com/h5/planet/cover_03.png",
+            "http://oss.caihongxingqiu.com/h5/planet/cover_04.png",
+            "http://oss.caihongxingqiu.com/h5/planet/cover_05.png",
+            "http://oss.caihongxingqiu.com/h5/planet/cover_06.png",
+            "http://oss.caihongxingqiu.com/h5/planet/cover_07.png",
+            "http://oss.caihongxingqiu.com/h5/planet/cover_08.png"
+        ];
+        if($backyard){
+            $star_home['backyard']['backyard_open'] = $backyard['backyard_open'];
+            $star_home['backyard']['backyard_img'] = $backyard['backyard_img'];
+        }else{
+            $star_home['backyard']['backyard_open'] = 0;
+            $star_home['backyard']['backyard_img'] = '';
+        }
+        $star_home['user']['username'] = $userInfo['username'];
+        $star_home['user']['avatar'] = $userInfo['avatar'];
         return $star_home;
 
     }
@@ -205,6 +228,21 @@ class BeanRepository
 
     }
 
+    //获取用户后院权限等信息
+    function backyard($uid)
+    {
+        try {
+            $url = config("customer.app_service_url").'/user/v2/backyard';
+            $array = [
+                'json' => ['uid' => $uid], 'query' => [], 'http_errors' => false,'headers'=>['Authorization'=>"Bearer ".JWTAuth::getToken()]
+            ];
+            return http($url,$array,'get');
+        } catch (\Exception $e) {
+            return [];
+        }
+
+    }
+
     //获取每日新闻
     function getNews($request) {
         try {

+ 1 - 0
app/Repositories/FeedRepositories.php

@@ -156,6 +156,7 @@ class FeedRepositories
 
         $data = $feedModel
             ->where($where)
+            ->whereIn('type',[4,5,6])//目前只展示发布,评论 关注
             ->orderBy('id', 'desc')
             ->paginate($perPage);
         if ($data) {

+ 1 - 1
public/index.php

@@ -10,7 +10,7 @@
 | is ready to receive HTTP / Console requests from the environment.
 |
 */
-
+ini_set('molten.service_name', 'community-service');
 $app = require __DIR__.'/../bootstrap/app.php';
 
 /*

+ 2 - 0
routes/api.php

@@ -22,6 +22,8 @@ $api->version('v1', [
     $api->get('getVodUploadAuth', 'AliYunVodController@getVodUploadAuth');
     $api->get('vod/upload/image', 'AliYunVodController@getImgUploadAuth');
     $api->get('getPlayUrlByVideoId', 'AliYunVodController@getPlayUrlByVideoId');
+    //下载量
+    $api->put('download_count', 'PostController@downloadCount');
     //获取所有行为
     $api->get('getAllBehavior', 'BehaviorController@getAllBehavior');
     $api->group(['middleware' => ['chxq_sign']], function ($api) {