q-koa 11.2.5 → 11.3.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.
|
@@ -161,6 +161,13 @@ exports.modelQuery = {
|
|
|
161
161
|
defaultValue: {},
|
|
162
162
|
}
|
|
163
163
|
|
|
164
|
+
exports.modelUpsert = {
|
|
165
|
+
type: Sequelize.JSON,
|
|
166
|
+
comment: '默认插入值',
|
|
167
|
+
allowNull: false,
|
|
168
|
+
defaultValue: {},
|
|
169
|
+
}
|
|
170
|
+
|
|
164
171
|
exports.editInline = {
|
|
165
172
|
type: Sequelize.JSON,
|
|
166
173
|
comment: '局部更新',
|
|
@@ -101,6 +101,7 @@ exports.loadModel = async ({ app, appName }) => {
|
|
|
101
101
|
is_split_count: config.is_split_count,
|
|
102
102
|
show_virtual: config.show_virtual,
|
|
103
103
|
modelQuery: config.modelQuery,
|
|
104
|
+
modelUpsert: config.modelUpsert,
|
|
104
105
|
editInline: config.editInline,
|
|
105
106
|
deleteCheckList: config.deleteCheckList,
|
|
106
107
|
bulkCreateList: config.bulkCreateList,
|
|
@@ -181,6 +181,8 @@ exports.showTables = async (ctx) => {
|
|
|
181
181
|
comment: lodash.get(target, 'comment', {}),
|
|
182
182
|
// 默认查询,覆盖之前
|
|
183
183
|
modelQuery: lodash.get(target, 'modelQuery', {}),
|
|
184
|
+
// 插入字段,覆盖之前
|
|
185
|
+
modelUpsert: lodash.get(target, 'modelUpsert', {}),
|
|
184
186
|
// 删除时检查是不是含有
|
|
185
187
|
deleteCheckList: lodash.get(target, 'deleteCheckList', []),
|
|
186
188
|
// 批量更新字段
|
package/core/file/utils/index.js
CHANGED
|
@@ -181,7 +181,6 @@ exports.getAppConfig = async ({ app, config, key, app_id, id }) => {
|
|
|
181
181
|
if (!(app && (config || key || app_id || id))) return null
|
|
182
182
|
const application =
|
|
183
183
|
app.cache.get('application') || (await app.model.application.findAll())
|
|
184
|
-
console.log(id)
|
|
185
184
|
const target = application.find(findConfig(config || key || app_id || id))
|
|
186
185
|
|
|
187
186
|
return target || null
|