q-koa 9.6.1 → 9.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core/app.js +30 -1
- package/core/config.js +1 -0
- package/core/file/plugins/routes/config.js +1 -0
- package/package.json +1 -1
package/core/app.js
CHANGED
|
@@ -1011,7 +1011,36 @@ class APP {
|
|
|
1011
1011
|
let _where
|
|
1012
1012
|
|
|
1013
1013
|
if (where) {
|
|
1014
|
-
|
|
1014
|
+
if (fn === 'findAndCountAll') {
|
|
1015
|
+
const formatWhere = _.mapValues(where, (item) => {
|
|
1016
|
+
if (_.isObject(item)) {
|
|
1017
|
+
if (
|
|
1018
|
+
item.hasOwnProperty('$notIn') &&
|
|
1019
|
+
typeof item.$notIn === 'string'
|
|
1020
|
+
) {
|
|
1021
|
+
return {
|
|
1022
|
+
$notIn: [Sequelize.literal(item.$notIn)],
|
|
1023
|
+
}
|
|
1024
|
+
}
|
|
1025
|
+
|
|
1026
|
+
if (
|
|
1027
|
+
item.hasOwnProperty('$in') &&
|
|
1028
|
+
typeof item.$in === 'string'
|
|
1029
|
+
) {
|
|
1030
|
+
return {
|
|
1031
|
+
$in: [Sequelize.literal(item.$in)],
|
|
1032
|
+
}
|
|
1033
|
+
}
|
|
1034
|
+
return item
|
|
1035
|
+
} else {
|
|
1036
|
+
return item
|
|
1037
|
+
}
|
|
1038
|
+
})
|
|
1039
|
+
_where = _.cloneDeep(formatWhere)
|
|
1040
|
+
} else {
|
|
1041
|
+
_where = _.cloneDeep(where)
|
|
1042
|
+
}
|
|
1043
|
+
|
|
1015
1044
|
// if (util.isObject(where)) {
|
|
1016
1045
|
// _where = _.cloneDeep(where);
|
|
1017
1046
|
// } else if (util.isString(where)) {
|
package/core/config.js
CHANGED