fixed get wrong tags that quote num is zero error

pull/197/head
Michael Li 2 years ago
parent 4ec9e1d08a
commit 47020f2a77
No known key found for this signature in database

@ -44,7 +44,7 @@ func (t *Tag) Get(db *gorm.DB) (*Tag, error) {
err := db.First(&tag).Error err := db.First(&tag).Error
if err != nil { if err != nil {
return &tag, err return nil, err
} }
return &tag, nil return &tag, nil
@ -84,7 +84,7 @@ func (t *Tag) List(db *gorm.DB, conditions *ConditionsT, offset, limit int) ([]*
} }
} }
if err = db.Where("is_del = ?", 0).Find(&tags).Error; err != nil { if err = db.Where("is_del = 0 and quote_num > 0").Find(&tags).Error; err != nil {
return nil, err return nil, err
} }

Loading…
Cancel
Save