Jelajahi Sumber

wesmiler 报恩寺项目提交

wesmiler 4 tahun lalu
induk
melakukan
a67a12b3aa
2 mengubah file dengan 8 tambahan dan 3 penghapusan
  1. 7 3
      app/Http/Controllers/IndexController.php
  2. 1 0
      routes/web.php

+ 7 - 3
app/Http/Controllers/IndexController.php

@@ -114,8 +114,12 @@ class IndexController extends Backend
 
     }
 
+    /**
+     * 数据分析统计
+     * @return array
+     */
     public function statistics(){
-        $cacheKey = "caches:statis:counts";
+        $cacheKey = "caches:statistics:counts";
         $datas = RedisService::get($cacheKey);
         $datas = $datas? json_decode($datas, true) : [];
         if($datas){
@@ -152,7 +156,7 @@ class IndexController extends Backend
     }
 
 
-    public function statisTable(){
+    public function statisticsTable(){
         $type = request()->get('type', 'trade');
         $dateType = request()->get('dateType', 0);
         $datas = [];
@@ -182,7 +186,7 @@ class IndexController extends Backend
         RedisService::keyDel("caches:index:*");
         RedisService::keyDel("caches:articles:*");
         RedisService::keyDel("caches:qrcodes:*");
-        RedisService::keyDel("caches:statis:*");
+        RedisService::keyDel("caches:statistics:*");
         return message(MESSAGE_OK, true);
     }
 }

+ 1 - 0
routes/web.php

@@ -75,6 +75,7 @@ Route::get('/index/getUserInfo', [IndexController::class, 'getUserInfo']);
 Route::post('/index/updateUserInfo', [IndexController::class, 'updateUserInfo']);
 Route::post('/index/updatePwd', [IndexController::class, 'updatePwd']);
 Route::post('/index/clearCache', [IndexController::class, 'clearCache']);
+Route::post('/index/statistics', [IndexController::class, 'statistics']);
 Route::post('/index/counts', [IndexController::class, 'counts']);
 
 // 用户管理