fix(develop): 修复报错
Showing
1 changed file
with
2 additions
and
0 deletions
| ... | @@ -49,10 +49,12 @@ public function publicAudition(Request $request) | ... | @@ -49,10 +49,12 @@ public function publicAudition(Request $request) |
| 49 | //查询符合条件活动 | 49 | //查询符合条件活动 |
| 50 | $data = $query->get(['id']); | 50 | $data = $query->get(['id']); |
| 51 | //插入有序集合中 | 51 | //插入有序集合中 |
| 52 | if ($data->isNotEmpty()){ | ||
| 52 | Redis::client()->del($key); | 53 | Redis::client()->del($key); |
| 53 | Redis::client()->zAdd($key, ...$data->map(fn(ActivitySubmitWork $item) => [random_int(50, 200), $item->getKey()])->flatten()->toArray()); | 54 | Redis::client()->zAdd($key, ...$data->map(fn(ActivitySubmitWork $item) => [random_int(50, 200), $item->getKey()])->flatten()->toArray()); |
| 54 | Redis::client()->expire($key, 2 * 60 * 60); | 55 | Redis::client()->expire($key, 2 * 60 * 60); |
| 55 | } | 56 | } |
| 57 | } | ||
| 56 | $recommendIds = Redis::client()->zRevRange($key, $startIndex, $endIndex); | 58 | $recommendIds = Redis::client()->zRevRange($key, $startIndex, $endIndex); |
| 57 | 59 | ||
| 58 | $data = $query->with(['activity:id,song_name,sub_title,cover', 'user:id,nick_name,real_name,avatar', 'user.styleTags:id,name']) | 60 | $data = $query->with(['activity:id,song_name,sub_title,cover', 'user:id,nick_name,real_name,avatar', 'user.styleTags:id,name']) | ... | ... |
-
Please register or sign in to post a comment