Commit 7323fcb1 by 赵庆

insert 

parent 769f527a
...@@ -232,6 +232,33 @@ class Dao { ...@@ -232,6 +232,33 @@ class Dao {
return this.db.query(sql, tmpParas); return this.db.query(sql, tmpParas);
} }
async customInsert(sql, paras, t) {
var tmpParas = null;
if (t && t != 'undefined') {
if (paras == null || paras == 'undefined') {
tmpParas = {
type: this.db.QueryTypes.INSERT
};
tmpParas.transaction = t;
} else {
tmpParas = {
replacements: paras,
type: this.db.QueryTypes.INSERT
};
tmpParas.transaction = t;
}
} else {
tmpParas = paras == null || paras == 'undefined' ? {
type: this.db.QueryTypes.INSERT
} : {
replacements: paras,
type: this.db.QueryTypes.INSERT
};
}
return this.db.query(sql, tmpParas);
}
async findCount(whereObj = null) { async findCount(whereObj = null) {
return this.model.count(whereObj, { return this.model.count(whereObj, {
logging: false logging: false
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment