diff --git a/app/Service/v3/Implementations/CollectStoreService.php b/app/Service/v3/Implementations/CollectStoreService.php index 72e07b0..5704681 100644 --- a/app/Service/v3/Implementations/CollectStoreService.php +++ b/app/Service/v3/Implementations/CollectStoreService.php @@ -67,7 +67,8 @@ class CollectStoreService implements CollectStoreServiceInterface public function countByUser($userId) { - return UserCollection::query()->where(['user_id' => $userId])->count(); + $marketIds = Market::query()->pluck('id'); + return UserCollection::query()->where(['user_id' => $userId])->whereIn('market_id', $marketIds)->count(); // $ssdb = ApplicationContext::getContainer()->get(SSDBTask::class); // $count = $ssdb->exec('get',SsdbKeys::COUNT_COLLECT_STORE_USER.$userId);