123456789101112131415161718192021222324252627282930313233 |
- package models
- import (
- "eta/eta_api/global"
- "time"
- )
- type SearchKeyWord struct {
- SearchKeyWordId int `gorm:"column:search_key_word_id;primaryKey;autoIncrement" description:"主键ID"`
- KeyWord string `description:"关键词"`
- From string `description:"来源,在什么地方筛选"`
- CreatedTime time.Time `description:"创建时间"`
- LastUpdatedTime time.Time `description:"更新时间"`
- TeleconferenceImage string `description:"电话会对应的类型图片"`
- BannerImage string `description:"Banner图"`
- }
- func AddTrendTagKeyWord(trend string) (err error) {
- o := global.DEFAULT_DB
- sql := " REPLACE INTO search_key_word (`key_word`,`from`) values (?,'trend') "
- err = o.Exec(sql, trend).Error
- return
- }
- func GetKeyWordListByFrom(from string) (list []*SearchKeyWord, err error) {
- o := global.DEFAULT_DB
- sql := " SELECT * FROM search_key_word WHERE `from` = ? ORDER BY created_time ASC "
- err = o.Raw(sql, from).Find(&list).Error
- return
- }
|