This commit is contained in:
shenquanyi
2025-08-27 15:36:36 +08:00
parent ec72c6a8b5
commit 2bd1d8c032
100 changed files with 25780 additions and 20 deletions

View File

@@ -40,11 +40,7 @@ const defaultFields = {
onUpdate: Sequelize.literal('CURRENT_TIMESTAMP'),
comment: '更新时间'
},
deleted_at: {
type: DataTypes.DATE,
allowNull: true,
comment: '删除时间'
}
};
/**
@@ -55,11 +51,7 @@ function extendModel(modelClass) {
// 添加通用的查询方法
modelClass.findAllActive = function(options = {}) {
return this.findAll({
...options,
where: {
...options.where,
deleted_at: null
}
...options
});
};