|
@@ -547,8 +547,16 @@ class RewardPointsController extends Controller
|
|
|
'followed' => $followed
|
|
'followed' => $followed
|
|
|
];
|
|
];
|
|
|
}
|
|
}
|
|
|
|
|
+ $today = Carbon::now()->format('Y-m-d');
|
|
|
|
|
+ $setKey = "browse_product:{$customer->id}:{$today}:set";
|
|
|
|
|
+
|
|
|
|
|
+ // 从 Redis Set 中获取今天已浏览的产品ID列表
|
|
|
|
|
+ $browsedProductIds = Redis::smembers($setKey);
|
|
|
|
|
+ $browsedProductIds = array_map('intval', $browsedProductIds);
|
|
|
|
|
|
|
|
return ApiResponse::success([
|
|
return ApiResponse::success([
|
|
|
|
|
+ 'browsed_product_ids' => $browsedProductIds,
|
|
|
|
|
+ 'browsed_count' => count($browsedProductIds),
|
|
|
'platforms' => $platforms,
|
|
'platforms' => $platforms,
|
|
|
'followed_count' => count(array_filter($platforms, fn($p) => $p['followed']))
|
|
'followed_count' => count(array_filter($platforms, fn($p) => $p['followed']))
|
|
|
]);
|
|
]);
|