diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 8be75a95..6d5dca69 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -7,6 +7,7 @@ on: - dev - 'jc/**' - 'feature/**' + - 'x/**' paths: - '**.go' - 'go.mod' diff --git a/internal/dao/jinzhu/dbr/tag.go b/internal/dao/jinzhu/dbr/tag.go index 5193df26..8570f574 100644 --- a/internal/dao/jinzhu/dbr/tag.go +++ b/internal/dao/jinzhu/dbr/tag.go @@ -48,7 +48,7 @@ func (t *Tag) Get(db *gorm.DB) (*Tag, error) { err := db.First(&tag).Error if err != nil { - return &tag, err + return nil, err } return &tag, nil @@ -88,7 +88,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 }