From 0a8818d39cdbff61a901ef9998c42e9f29cf1f67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=87=E5=A4=A9?= Date: Tue, 17 Jul 2018 11:35:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Djoin=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E4=B8=80=E5=A4=84=E7=9A=84=E7=AC=94=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- History.md | 4 ++++ docs/3.x.md | 2 ++ lib/utils.js | 2 +- package.json | 2 +- 4 files changed, 8 insertions(+), 2 deletions(-) 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": {