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 CHANGED
@@ -1011,7 +1011,36 @@ class APP {
1011
1011
  let _where
1012
1012
 
1013
1013
  if (where) {
1014
- _where = _.cloneDeep(where)
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
@@ -99,6 +99,7 @@ module.exports = {
99
99
  $lte: Sequelize.Op.lte,
100
100
  $between: Sequelize.Op.between,
101
101
  $notIn: Sequelize.Op.notIn,
102
+ $in: Sequelize.Op.in,
102
103
  },
103
104
  },
104
105
  app: {
@@ -8,6 +8,7 @@ module.exports = {
8
8
  { key: 'parent_id' },
9
9
  {
10
10
  key: 'key',
11
+ symbol: '$like',
11
12
  },
12
13
  {
13
14
  key: 'url',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "q-koa",
3
- "version": "9.6.1",
3
+ "version": "9.7.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {