Browse Source

收藏统计

master
weigang 5 years ago
parent
commit
ac90246f47
  1. 18
      app/Service/v3/Implementations/CollectStoreService.php

18
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)

Loading…
Cancel
Save