Skip to content

Commit

Permalink
修复 查询标签下的条目
Browse files Browse the repository at this point in the history
  • Loading branch information
hqweay committed Jun 7, 2019
1 parent 14bbc7b commit 80b5a59
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/shared/db/mapper/itemMapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,17 @@ export function getItemsByTemplateName(temName) {
// 通过 标签名 获取 条目
// bug 应该判断 tagName 是否在 tag 列表里
export function getItemsByTagName(tagName) {
return db.read().get('item').filter({ tag_name: tagName }).value()
// 我可太他妈聪明了
return db.read().get('item').filter(function (o) {
console.log(tagName);
if (o.tag_name.indexOf(tagName) !== -1) {
console.log("true");
return true;
} else {
console.log("false");
return false;
}
}).value();
}


Expand Down

0 comments on commit 80b5a59

Please sign in to comment.