Skip to content
This repository has been archived by the owner on Jun 14, 2021. It is now read-only.

Commit

Permalink
fix: where
Browse files Browse the repository at this point in the history
  • Loading branch information
XiaoLin committed Apr 29, 2020
1 parent 5935d5b commit 91623d0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/module/metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,13 @@ class Metadata {
async searchMetadata (searchStr, page, size) {
const params = `${searchStr}`.split(' ', parseInt(config.get('system.searchParmaNum')) || 3)

let result = db('metadatas').orderBy('releaseDate', 'desc').where('updateTime', '>', '-1')
let result = db('metadatas').orderBy('releaseDate', 'desc')

const _param = params.shift()

result = result.where('title', 'like', `%${_param}%`)
.orWhere('companyName', 'like', `%${_param}%`)
.orWhere('companyId', 'like', `%${_param}%`)

for (const i in params) {
const param = params[i]
Expand Down

0 comments on commit 91623d0

Please sign in to comment.