Skip to content

Commit

Permalink
chore: simplify sql2
Browse files Browse the repository at this point in the history
Signed-off-by: Xeu <thankrain@qq.com>
  • Loading branch information
OXeu committed Dec 3, 2024
1 parent 218230a commit 6ee987d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions server/src/services/feed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,9 +326,10 @@ export function FeedService() {
const searchKeyword = `%${keyword}%`;
const where = or(like(feeds.title, searchKeyword),
like(feeds.content, searchKeyword),
like(feeds.summary, searchKeyword));
like(feeds.summary, searchKeyword),
like(feeds.alias, searchKeyword));
const feed_list = (await cache.getOrSet(cacheKey, () => db.query.feeds.findMany({
where: admin ? where : and(where, eq(feeds.draft, 0)),
where: and(where, eq(feeds.draft, 0)),
columns: admin ? undefined : {
draft: false,
listed: false
Expand Down

0 comments on commit 6ee987d

Please sign in to comment.