From f17199bf1b32704d34f0eed3e70bc85ba0e14062 Mon Sep 17 00:00:00 2001 From: weigang Date: Thu, 24 Sep 2020 15:03:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B6=E8=97=8F=E6=95=B0=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Service/v3/Implementations/CollectStoreService.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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);