q-koa 13.8.11 → 13.8.12

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.
@@ -86,19 +86,17 @@ exports.init = async (ctx) => {
86
86
  raw: true,
87
87
  })
88
88
 
89
- let list = []
89
+ const list = []
90
90
  let number = 0
91
91
  for (let i = 0; i < parentList.length; i++) {
92
92
  number += 1
93
+ const parentId = number
93
94
  const { id: parent_id, ...rest } = parentList[i]
94
- list = [
95
- ...list,
96
- {
97
- id: number,
98
- ...rest,
99
- parent_id: 0,
100
- },
101
- ]
95
+ list.push({
96
+ id: parentId,
97
+ ...rest,
98
+ parent_id: 0,
99
+ })
102
100
  const childList = await app.model.setting.findAll({
103
101
  where: {
104
102
  parent_id,
@@ -106,20 +104,15 @@ exports.init = async (ctx) => {
106
104
  order: [['id', 'ASC']],
107
105
  raw: true,
108
106
  })
109
- list = [
110
- ...list,
111
- ...childList.map((item, index) => {
112
- const { id: child_id, ...restChild } = item
113
- const id = number + index + 1
114
-
115
- return {
116
- id,
117
- ...restChild,
118
- parent_id: number,
119
- }
120
- }),
121
- ]
122
- number += childList.length
107
+ for (let j = 0; j < childList.length; j++) {
108
+ number += 1
109
+ const { id: child_id, ...restChild } = childList[j]
110
+ list.push({
111
+ id: number,
112
+ ...restChild,
113
+ parent_id: parentId,
114
+ })
115
+ }
123
116
  }
124
117
 
125
118
  await app.model.setting.sync({ force: true })
@@ -723,7 +723,6 @@ module.exports = class Singleton {
723
723
  async addGood(payLoad) {
724
724
  const access_token = await this.getAccessToken()
725
725
  const url = util.format(addGoodUrl, access_token)
726
- console.log('payLoad', payLoad)
727
726
  const result = await wxAxios
728
727
  .post(url, {
729
728
  ...payLoad,
@@ -359,7 +359,7 @@ const filterFunction = (target, data) => {
359
359
  return data[key] > target[key].$gt
360
360
  } else if ('$gte' in target[key]) {
361
361
  if (key.endsWith('time') || key.endsWith('_at')) {
362
- return moment(data[key]).diff(moment(target[key].$gt), 'seconds') >= 0
362
+ return moment(data[key]).diff(moment(target[key].$gte), 'seconds') >= 0
363
363
  }
364
364
  return data[key] >= target[key].$gte
365
365
  } else if ('$lt' in target[key]) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "q-koa",
3
- "version": "13.8.11",
3
+ "version": "13.8.12",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {