wesmiler 6 месяцев назад
Родитель
Сommit
a4703d3f4e

+ 5 - 9
app/Http/Controllers/Api/v1/IndexController.php

@@ -6,6 +6,7 @@ use App\Http\Controllers\Api\webApp;
 use App\Services\Api\AccountService;
 use App\Services\Api\MemberService;
 use App\Services\Api\OrderService;
+use App\Services\Common\NoticeService;
 use App\Services\ConfigService;
 use App\Services\MpService;
 use App\Services\RedisService;
@@ -44,10 +45,7 @@ class IndexController extends webApp
                     'withdraw_fee' => ConfigService::make()->getConfigByCode('withdraw_fee', 0),
                     'kfUrl' => ConfigService::make()->getConfigByCode('wechat_kf_url', ''),
                     'img_compress'=> ConfigService::make()->getConfigByCode('preview_img_compress', ''),
-                    'notices' => [
-                        ['id' => 1, 'title' => '平台上线', 'url' => ''],
-                        ['id' => 2, 'title' => '这里是一段滚动资讯这里是一段滚动资讯..', 'url' => '']
-                    ],
+                    'notices' => NoticeService::make()->getRecommandList(),
 
                 ];
                 RedisService::set($cacheKey, $config, 3600);
@@ -74,11 +72,9 @@ class IndexController extends webApp
         }
 
         $data = [
-            // 首页数据
-            'counts' => [
-                'dayIncome' => AccountService::make()->getTotalByDay($this->userId, 1),
-                'dayOrder' => OrderService::make()->getCountByDay($this->userId, 3),
-            ],
+            // 线上课程
+            'courses' => [],
+            'articles'=>[]
         ];
         return showJson(1010, true, $data);
     }

+ 1 - 1
app/Services/Common/NoticeService.php

@@ -119,7 +119,7 @@ class NoticeService extends BaseService
      * @param $num
      * @return array|mixed
      */
-    public function getRecommandList($num)
+    public function getRecommandList($num=20)
     {
         $cacheKey = "caches:notices:{$num}";
         $datas = RedisService::get($cacheKey);