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
|
-
|
|
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
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
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
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
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,
|
package/core/file/utils/index.js
CHANGED
|
@@ -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].$
|
|
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]) {
|