Browse Source

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

sunxbiao 1 year ago
parent
commit
c853bdcdf4
1 changed files with 9 additions and 0 deletions
  1. 9 0
      app/common/repositories/finance/FinanceRepository.php

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

@@ -265,6 +265,15 @@ class FinanceRepository extends BaseRepository
265
     public function user_overview($mer_id = 0)
265
     public function user_overview($mer_id = 0)
266
     {
266
     {
267
         $where = "1=1 ";
267
         $where = "1=1 ";
268
+
269
+        // 需要过滤掉的用户
270
+        /** @var UserRepository $userRepository */
271
+        $userRepository = app()->make(UserRepository::class);
272
+        $invalidUidList = $userRepository->getInvalidUidList();
273
+        if (!empty($invalidUidList)) {
274
+            $invalidSqlStr = ' AND uid NOT IN (' . implode(',', $invalidUidList) . ')';
275
+            $where .= $invalidSqlStr;
276
+        }
268
         if ($mer_id) {
277
         if ($mer_id) {
269
             $mer_uid = Db::name('merchant')->where('mer_id', $mer_id)->value('uid');
278
             $mer_uid = Db::name('merchant')->where('mer_id', $mer_id)->value('uid');
270
             $userRepository = app()->make(UserRepository::class);
279
             $userRepository = app()->make(UserRepository::class);