wesmiler 2 лет назад
Родитель
Сommit
cc6e7e3d38
1 измененных файлов с 6 добавлено и 6 удалено
  1. 6 6
      app/Services/Api/AccountLogService.php

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

@@ -164,8 +164,8 @@ class AccountLogService extends BaseService
     public function getScoreCounts($userId=0, int $coinType=4)
     {
         $counts = [
-            'day_total' => $this->getScoreCountByDate(0, $coinType, 23,3),
-            'award_total' => $this->getScoreCountByDate(0, $coinType, 9,3),
+            'day_total' => $this->getScoreCountByDate(4, $coinType, 23,3),
+            'award_total' => $this->getScoreCountByDate(1, $coinType, 9,3),
         ];
 
         $xdTotal = ConfigService::make()->getConfigByCode('xd_total', 100000000);
@@ -284,17 +284,17 @@ class AccountLogService extends BaseService
      * @param string $field
      * @return array|mixed
      */
-    public function getScoreCountByDate($userId=0, $coinType, $type=23, $dateType=1, $field='actual_money')
+    public function getScoreCountByDate($userType = 1, $coinType, $type=23, $dateType=1, $field='actual_money')
     {
-        $cacheKey = "caches:accounts:score_date_{$userId}_{$coinType}_{$type}_{$dateType}";
+        $cacheKey = "caches:accounts:score_date_{$userType}_{$coinType}_{$type}_{$dateType}";
         $data = RedisService::get($cacheKey);
         if($data){
             return  moneyFormat($data, 2);
         }
 
         $where = ['coin_type'=> $coinType,'status'=>1,'mark'=>1];
-        if($userId){
-            $where['user_id'] = $userId;
+        if($userType){
+            $where['user_type'] = $userType;
         }
 
         if($type>0){