doomiwork 3.7.6 → 3.7.8
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.
|
@@ -45,7 +45,7 @@ class Database {
|
|
|
45
45
|
async existedSqlData(sqlCommand, parameters, conn, autoclose = true) {
|
|
46
46
|
let sqlExecute = await this.executeSql(sqlCommand, parameters, conn, autoclose);
|
|
47
47
|
if (!sqlExecute.successed) return { successed: false }
|
|
48
|
-
if (!sqlExecute.rows || sqlExecute.rows.length == 0) return {
|
|
48
|
+
if (!sqlExecute.rows || sqlExecute.rows.length == 0) return { successed: true, existed: false }
|
|
49
49
|
return { successed: true, existed: true, ...sqlExecute.rows[0] }
|
|
50
50
|
}
|
|
51
51
|
/**
|
package/package.json
CHANGED
|
@@ -50,7 +50,13 @@ class ViewHelper {
|
|
|
50
50
|
if (element.action && element.action.indexOf(doWhat) < 0) continue;
|
|
51
51
|
let bodyKey = element.mapping || element.name;
|
|
52
52
|
let postValue = req.body[bodyKey];
|
|
53
|
-
|
|
53
|
+
////body中没有这个属性
|
|
54
|
+
//&& element.ignoreundefined == true
|
|
55
|
+
if (postValue === undefined ){
|
|
56
|
+
if ((doWhat == 'update' && !element.required) ||
|
|
57
|
+
(doWhat == 'create' && !element.required && !element.default && !element.nullValue))
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
54
60
|
///去除两边的空格,默认是去掉空格
|
|
55
61
|
if (typeof (postValue) === 'string'){
|
|
56
62
|
if ((element.trim == null || element.trim == true)) postValue.trim();
|