Commit 326d99ba 326d99bacbe60362b813a69fa6a2ef91ce0f5a58 by 杨俊

fix(develop): 修复报错

1 parent 74c0cec8
...@@ -49,9 +49,11 @@ public function publicAudition(Request $request) ...@@ -49,9 +49,11 @@ public function publicAudition(Request $request)
49 //查询符合条件活动 49 //查询符合条件活动
50 $data = $query->get(['id']); 50 $data = $query->get(['id']);
51 //插入有序集合中 51 //插入有序集合中
52 Redis::client()->del($key); 52 if ($data->isNotEmpty()){
53 Redis::client()->zAdd($key, ...$data->map(fn(ActivitySubmitWork $item) => [random_int(50, 200), $item->getKey()])->flatten()->toArray()); 53 Redis::client()->del($key);
54 Redis::client()->expire($key, 2 * 60 * 60); 54 Redis::client()->zAdd($key, ...$data->map(fn(ActivitySubmitWork $item) => [random_int(50, 200), $item->getKey()])->flatten()->toArray());
55 Redis::client()->expire($key, 2 * 60 * 60);
56 }
55 } 57 }
56 $recommendIds = Redis::client()->zRevRange($key, $startIndex, $endIndex); 58 $recommendIds = Redis::client()->zRevRange($key, $startIndex, $endIndex);
57 59
......