Kaynağa Gözat

财务概况统计的数据需要去除删除账号和测试账号的数据-会员概况

sunxbiao 1 yıl önce
ebeveyn
işleme
b4c4cb9404

+ 12 - 0
app/common/repositories/finance/FinanceRepository.php

@@ -392,6 +392,18 @@ class FinanceRepository extends BaseRepository
392
         $weekWhere = " 1=1";
392
         $weekWhere = " 1=1";
393
         $dayWhere = " 1=1";
393
         $dayWhere = " 1=1";
394
 
394
 
395
+        // 需要过滤掉的用户
396
+        /** @var UserRepository $userRepository */
397
+        $userRepository = app()->make(UserRepository::class);
398
+        $invalidUidList = $userRepository->getInvalidUidList();
399
+        if (!empty($invalidUidList)) {
400
+            $invalidSqlStr = ' AND uid NOT IN (' . implode(',', $invalidUidList) . ')';
401
+            $where .= $invalidSqlStr;
402
+            $sWeekWhere .= $invalidSqlStr;
403
+            $weekWhere .= $invalidSqlStr;
404
+            $dayWhere .= $invalidSqlStr;
405
+        }
406
+
395
         $currentDate = date('Y-m-d');
407
         $currentDate = date('Y-m-d');
396
         // 上周的开始日期(周一)
408
         // 上周的开始日期(周一)
397
         $startDate = date('Y-m-d', strtotime('last Monday', strtotime($currentDate)));
409
         $startDate = date('Y-m-d', strtotime('last Monday', strtotime($currentDate)));