我的代码如下所示:
DowngradeModule
但是以某种方式给我错误:
const testMethod = (x, y, isZ) => {
return new Promise((resolve, reject) => {
return db.sequelize.transaction((t) => {
db.wallet.find({where: {id: x}}).then((info) => {
if (isZ) {
info.test_balance = (parseFloat(info.test_balance) - parseFloat(y)).toFixed(2);
}
else {
info.test_balance = (parseFloat(info.test_balance) + parseFloat(y)).toFixed(2);
}
info.save({transaction: t, autocommit: false}).then((updatedInfo) => {
t.commit();
resolve();
}
).catch((err) => {
t.rollback();
reject();
});
}).catch((err) => {
reject();
});
});
});
};