wesmiler 2 years ago
parent
commit
72c272555f

+ 2 - 1
app/Http/Controllers/Api/v1/AccountController.php

@@ -72,7 +72,8 @@ class AccountController extends webApp
     {
         $coinType =request()->post('coin_type',1);
         $userType =request()->post('user_type',1);
-        $datas = AccountLogService::make()->getCountsByType($this->userId, $coinType, $userType);
+        $type =request()->post('type',1);
+        $datas = AccountLogService::make()->getCountsByType($this->userId, $coinType, $userType, $type);
         return showJson(1010, true, $datas);
     }
 

+ 8 - 6
app/Services/Api/AccountLogService.php

@@ -161,7 +161,7 @@ class AccountLogService extends BaseService
      * @param int $userType 用户账户类型
      * @return \float[][]
      */
-    public function getCountsByType($userId, $coinType = 1, $userType = 1)
+    public function getCountsByType($userId, $coinType = 1, $userType = 1, $type=1)
     {
         $datas = [
             'counts' => [
@@ -169,7 +169,10 @@ class AccountLogService extends BaseService
                 'yestday' => $this->getCountDataByDate($userId, $coinType, $userType,2),
                 'total' => $this->getCountDataByDate($userId, $coinType, $userType,0)
             ],
-            'tables' => [
+        ];
+
+        if($type == 1){
+            $datas['tables'] = [
                 'gl_burn' => $this->getCountDataByType($userId, $coinType, $userType,98),
                 'level_burn' => $this->getCountDataByType($userId, $coinType, $userType,97),
                 'live' => $this->getCountDataByType($userId, $coinType, $userType,1),
@@ -178,11 +181,10 @@ class AccountLogService extends BaseService
                 'gl' => $this->getCountDataByType($userId, $coinType, $userType,13),
                 'point' => $this->getCountDataByType($userId, $coinType, $userType,14),
                 'invite' => $this->getCountDataByType($userId, $coinType, $userType,12),
-            ]
-        ];
-
+            ];
+            $datas['tables'] = array_values($datas['tables']);
+        }
 
-        $datas['tables'] = array_values($datas['tables']);
         return $datas;
     }