From ac90246f474974bd47db1e0c6bb9b0ef14e9d16a Mon Sep 17 00:00:00 2001 From: weigang Date: Thu, 24 Sep 2020 14:29:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B6=E8=97=8F=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../v3/Implementations/CollectStoreService.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/app/Service/v3/Implementations/CollectStoreService.php b/app/Service/v3/Implementations/CollectStoreService.php index 8ecbe1d..72e07b0 100644 --- a/app/Service/v3/Implementations/CollectStoreService.php +++ b/app/Service/v3/Implementations/CollectStoreService.php @@ -66,16 +66,22 @@ class CollectStoreService implements CollectStoreServiceInterface //获取用户收藏店铺数量 public function countByUser($userId) { - $ssdb = ApplicationContext::getContainer()->get(SSDBTask::class); - $count = $ssdb->exec('get',SsdbKeys::COUNT_COLLECT_STORE_USER.$userId); - return $count; + + return UserCollection::query()->where(['user_id' => $userId])->count(); + + // $ssdb = ApplicationContext::getContainer()->get(SSDBTask::class); + // $count = $ssdb->exec('get',SsdbKeys::COUNT_COLLECT_STORE_USER.$userId); + // return $count; } //获取店铺被收藏数量 public function countByStore($storeId) { - $ssdb = ApplicationContext::getContainer()->get(SSDBTask::class); - $count = $ssdb->exec('get',SsdbKeys::COUNT_COLLECT_STORE.$storeId); - return $count; + + return UserCollection::query()->where(['store_id' => $storeId])->count(); + + // $ssdb = ApplicationContext::getContainer()->get(SSDBTask::class); + // $count = $ssdb->exec('get',SsdbKeys::COUNT_COLLECT_STORE.$storeId); + // return $count; } public function getListByUser($userId)