From 3b34bc562ed08e76271baae697caea85e155a618 Mon Sep 17 00:00:00 2001 From: Menci Date: Tue, 13 Dec 2016 06:48:45 +0800 Subject: [PATCH] Fix paginate lead to SQL syntax error when no data to query --- models/common.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/models/common.js b/models/common.js index db7349e..4aa50a0 100644 --- a/models/common.js +++ b/models/common.js @@ -88,6 +88,8 @@ class Model { } static async query(paginate, where, order) { + if (paginate && !paginate.pageCnt) return []; + let options = { where: where, order: order