package variety_tag

import "hongze/hongze_yb/global"

func GetVarietyTagList() (list []*VarietyTag, err error) {
	err = global.DEFAULT_MYSQL.Model(VarietyTag{}).
		Where("state = 1").
		Order("sort ASC").
		Scan(&list).Error
	return
}

func GetVarietyTagById(varietyTagId int) (item *VarietyTag, err error) {
	err = global.DEFAULT_MYSQL.Model(VarietyTag{}).
		Where("variety_tag_id = ? AND state = 1", varietyTagId).
		First(&item).Error
	return
}