|
|
@@ -27,8 +27,8 @@ class StatVisitClass extends BaseClass
|
|
|
{
|
|
|
$date = isset($date) == false ? date("Ymd") : $date;
|
|
|
$customId = $custom->id ?? 0;
|
|
|
- $ghsShopId = $ghs->shopId ?? 0;
|
|
|
- $cacheKey = 'ghs_mall_visit_' . $ghsShopId . '_' . $date;
|
|
|
+ $ghsMainId = $ghs->mainId ?? 0;
|
|
|
+ $cacheKey = 'ghs_mall_visit_' . $ghsMainId . '_' . $date;
|
|
|
$exists = Yii::$app->redis->executeCommand('SISMEMBER', [$cacheKey, $customId]);
|
|
|
if (empty($exists)) {
|
|
|
Yii::$app->redis->executeCommand('SADD', [$cacheKey, $customId]);
|
|
|
@@ -92,9 +92,9 @@ class StatVisitClass extends BaseClass
|
|
|
//清空访客
|
|
|
public static function clearVisit($shop, $date = null)
|
|
|
{
|
|
|
- $shopId = $shop->id ?? 0;
|
|
|
+ $mainId = $shop->mainId ?? 0;
|
|
|
$date = isset($date) == false ? date("Ymd") : $date;
|
|
|
- $cacheKey = 'ghs_mall_visit_' . $shopId . '_' . $date;
|
|
|
+ $cacheKey = 'ghs_mall_visit_' . $mainId . '_' . $date;
|
|
|
Yii::$app->redis->executeCommand('DEL', [$cacheKey]);
|
|
|
}
|
|
|
|
|
|
@@ -110,9 +110,9 @@ class StatVisitClass extends BaseClass
|
|
|
//获取访客ID
|
|
|
public static function getVisitCustomIds($shop, $date = null)
|
|
|
{
|
|
|
- $shopId = $shop->id ?? 0;
|
|
|
+ $mainId = $shop->mainId ?? 0;
|
|
|
$date = isset($date) == false ? date("Ymd") : $date;
|
|
|
- $cacheKey = 'ghs_mall_visit_' . $shopId . '_' . $date;
|
|
|
+ $cacheKey = 'ghs_mall_visit_' . $mainId . '_' . $date;
|
|
|
$ids = Yii::$app->redis->executeCommand('SMEMBERS', [$cacheKey]);
|
|
|
return $ids;
|
|
|
}
|