Skip to content

Commit 218230a

Browse files
committed
chore: simplify sql
Signed-off-by: Xeu <thankrain@qq.com>
1 parent ab6a159 commit 218230a

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

server/src/services/feed.ts

+11-12
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
import { and, count, desc, eq, like, or } from "drizzle-orm";
2-
import Elysia, { t } from "elysia";
3-
import { XMLParser } from "fast-xml-parser";
1+
import {and, count, desc, eq, like, or} from "drizzle-orm";
2+
import Elysia, {t} from "elysia";
3+
import {XMLParser} from "fast-xml-parser";
44
import html2md from 'html-to-md';
5-
import type { DB } from "../_worker";
6-
import { feeds, visits } from "../db/schema";
7-
import { setup } from "../setup";
8-
import { ClientConfig, PublicCache } from "../utils/cache";
9-
import { getDB } from "../utils/di";
10-
import { extractImage } from "../utils/image";
11-
import { bindTagToPost } from "./tag";
5+
import type {DB} from "../_worker";
6+
import {feeds, visits} from "../db/schema";
7+
import {setup} from "../setup";
8+
import {ClientConfig, PublicCache} from "../utils/cache";
9+
import {getDB} from "../utils/di";
10+
import {extractImage} from "../utils/image";
11+
import {bindTagToPost} from "./tag";
1212

1313
export function FeedService() {
1414
const db: DB = getDB();
@@ -326,8 +326,7 @@ export function FeedService() {
326326
const searchKeyword = `%${keyword}%`;
327327
const where = or(like(feeds.title, searchKeyword),
328328
like(feeds.content, searchKeyword),
329-
like(feeds.summary, searchKeyword),
330-
like(feeds.alias, searchKeyword));
329+
like(feeds.summary, searchKeyword));
331330
const feed_list = (await cache.getOrSet(cacheKey, () => db.query.feeds.findMany({
332331
where: admin ? where : and(where, eq(feeds.draft, 0)),
333332
columns: admin ? undefined : {

0 commit comments

Comments
 (0)