feat:完善项目
This commit is contained in:
@ -225,6 +225,8 @@ func FirstWhere(model IModel, where ...*ModelWhere) (bool, error) {
|
||||
for _, wo := range where {
|
||||
db = db.Where(wo.Condition, wo.Value)
|
||||
}
|
||||
} else {
|
||||
db = db.Where(fmt.Sprintf("%s = %d", FieldsForID, model.GetID()))
|
||||
}
|
||||
if db.Migrator().HasColumn(model, FieldsForDeleted) {
|
||||
db = db.Where(FieldsForDeleted, DeleteStatusForNot)
|
||||
@ -245,6 +247,8 @@ func FirstField(model IModel, fields []string, where ...*ModelWhere) (bool, erro
|
||||
for _, wo := range where {
|
||||
db = db.Where(wo.Condition, wo.Value)
|
||||
}
|
||||
} else {
|
||||
db = db.Where(fmt.Sprintf("%s = %d", FieldsForID, model.GetID()))
|
||||
}
|
||||
if db.Migrator().HasColumn(model, FieldsForDeleted) {
|
||||
db = db.Where(FieldsForDeleted, DeleteStatusForNot)
|
||||
|
Reference in New Issue
Block a user