Эх сурвалжийг харах

修复小程序端统计信息

yb 2 сар өмнө
parent
commit
f5813f6cb1

+ 2 - 1
app/wechat/service/UserService.php

@@ -374,7 +374,8 @@ class UserService
         $where[] = [function($query) use ($diffNums, $currentTime){
             $query->orWhereRaw("check_status IN (-1, 1)")
                 ->orWhereRaw("check_status = 2 AND current_status IN (-1,3,4)")
-                ->orWhereRaw("((visit_time + {$diffNums}) - {$currentTime} > 0 AND current_status = 2 AND check_status = 2)");
+                ->orWhereRaw("((visit_time + {$diffNums}) - {$currentTime} > 0 AND current_status = 2 AND check_status = 2)")
+                ->orWhereRaw("((visit_time + {$diffNums}) - {$currentTime} <= 0 AND (visit_time + ({$diffNums} * 4)) - {$currentTime} > 0 AND current_status = 2 AND check_status = 2 AND belong_status = 1)")->whereOr('belong_status','<>', 1);
         }];
         //客户总量
         $customNums = MarketCustomer::where($where)->count();