q-koa 8.6.4 → 8.6.7

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.
@@ -219,7 +219,7 @@ exports.getTable = async (ctx) => {
219
219
  ).forEach((attr) => {
220
220
  obj[attr] = lodash.merge(
221
221
  app.attributes[model][attr],
222
- result[attr],
222
+ lodash.omitBy(result[attr], lodash.isNull),
223
223
  app.config[_model].comment && app.config[_model].comment
224
224
  ? app.config[_model].comment[attr]
225
225
  : {}
@@ -229,7 +229,7 @@ exports.getTable = async (ctx) => {
229
229
  Object.keys(result).forEach((attr) => {
230
230
  obj[attr] = lodash.merge(
231
231
  app.attributes[model][attr],
232
- result[attr],
232
+ lodash.omitBy(result[attr], lodash.isNull),
233
233
  app.config[_model].comment && app.config[_model].comment
234
234
  ? app.config[_model].comment[attr]
235
235
  : {}
@@ -16,13 +16,11 @@ exports.getList = (config) => (type) => {
16
16
  }
17
17
 
18
18
  exports.getObject = (config, app) => async (type) => {
19
+ const findConfig = (item) => item.config === type || item.pay_config === type
19
20
  if (app) {
20
21
  const applicationList = app.cache.get('application')
21
- if (
22
- applicationList &&
23
- applicationList.find((item) => item.config === type)
24
- ) {
25
- return applicationList.find((item) => item.config === type)
22
+ if (applicationList && applicationList.find(findConfig)) {
23
+ return applicationList.find(findConfig)
26
24
  }
27
25
 
28
26
  if (!applicationList) {
@@ -32,7 +30,7 @@ exports.getObject = (config, app) => async (type) => {
32
30
  if (result.length > 0) {
33
31
  app.cache.set('application', JSON.parse(JSON.stringify(result)))
34
32
 
35
- const target = result.find((item) => item.config === type)
33
+ const target = result.find(findConfig)
36
34
  if (target) {
37
35
  return target
38
36
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "q-koa",
3
- "version": "8.6.4",
3
+ "version": "8.6.7",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {