|
@@ -393,31 +393,6 @@ class RewardPointsController extends Controller
|
|
|
], "You earned {$points} points for browsing this product!");
|
|
], "You earned {$points} points for browsing this product!");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
- * 获取今天已浏览并获得积分的产品列表
|
|
|
|
|
- *
|
|
|
|
|
- * @return \Illuminate\Http\JsonResponse
|
|
|
|
|
- */
|
|
|
|
|
- public function getBrowsedProducts()
|
|
|
|
|
- {
|
|
|
|
|
- $customer = auth()->guard('customer')->user();
|
|
|
|
|
-
|
|
|
|
|
- if (!$customer) {
|
|
|
|
|
- return ApiResponse::unauthorized();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- $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)
|
|
|
|
|
- ]);
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 支持的关注平台
|
|
* 支持的关注平台
|
|
@@ -552,7 +527,8 @@ class RewardPointsController extends Controller
|
|
|
|
|
|
|
|
// 从 Redis Set 中获取今天已浏览的产品ID列表
|
|
// 从 Redis Set 中获取今天已浏览的产品ID列表
|
|
|
$browsedProductIds = Redis::smembers($setKey);
|
|
$browsedProductIds = Redis::smembers($setKey);
|
|
|
- $browsedProductIds = array_map('intval', $browsedProductIds);
|
|
|
|
|
|
|
+
|
|
|
|
|
+ //$browsedProductIds = array_map('intval', $browsedProductIds);
|
|
|
|
|
|
|
|
return ApiResponse::success([
|
|
return ApiResponse::success([
|
|
|
'browsed_product_ids' => $browsedProductIds,
|
|
'browsed_product_ids' => $browsedProductIds,
|