diff --git a/History.md b/History.md index 52f5652..dc106ba 100644 --- a/History.md +++ b/History.md @@ -1,3 +1,7 @@ +# 3.0.5 / 2018-07-17 +* 修复join方法一处的笔误 + + # 3.0.4 / 2018-07-09 * 修复filter解析值为空字符串或0异常的bug diff --git a/docs/3.x.md b/docs/3.x.md index a348ae2..cf42661 100644 --- a/docs/3.x.md +++ b/docs/3.x.md @@ -238,6 +238,7 @@ db.table('student') > * $gt 大于 > * $gte 大于等于 > * $eq 等于 +> * $ne 不等于 ```javascript @@ -249,6 +250,7 @@ db // 现有的API不满足时, 可以自己写sql条件, 更复杂自己根据需求写即可 .filter({ name: { $sql: 'IS NULL' } }) + .filter({ score: { $sql: 'score + 1' } }) .filter({ id: { $in: [11, 13, 29] } }) // 查询id在给定的这几个值的所有学生 diff --git a/lib/utils.js b/lib/utils.js index 65a71b1..ff8df2e 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -159,7 +159,7 @@ const parser = { let sql = '' for (let it of tables) { it.table = fixtable(it.table) - sql += ` JOIN ${it[0]} ON ${it.on} ` + sql += ` JOIN ${it.table} ON ${it.on} ` } return sql }, diff --git a/package.json b/package.json index b8d0868..7773b27 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mysqli", - "version": "3.0.4", + "version": "3.0.5", "description": "MySQL tool", "main": "index.js", "dependencies": {