bianjunhui 1 tydzień temu
rodzic
commit
3a965cae23

+ 8 - 0
packages/Longyi/RewardPoints/src/Http/Controllers/RewardPointsController.php

@@ -547,8 +547,16 @@ class RewardPointsController extends Controller
                 '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([
+            'browsed_product_ids' => $browsedProductIds,
+            'browsed_count' => count($browsedProductIds),
             'platforms' => $platforms,
             'followed_count' => count(array_filter($platforms, fn($p) => $p['followed']))
         ]);