package crm

import (
	"hongze/hz_eta_docs_api/global"
	"time"
)

// EtaVersionUpdateLog ETA版本更新日志表
type EtaVersionUpdateLog struct {
	Id         int       `gorm:"primaryKey;column:id;type:int(10) unsigned;not null" json:"id"`
	Version    string    `gorm:"column:version;type:varchar(16);not null;default:''" json:"version"` // 版本号
	Content    string    `gorm:"column:content;type:text" json:"content"`                            // 更新内容
	UpdateDate time.Time `gorm:"column:update_date;type:date" json:"update_date"`                    // 更新日期
	CreateTime time.Time `gorm:"column:create_time;type:datetime" json:"create_time"`                // 创建时间
	ModifyTime time.Time `gorm:"column:modify_time;type:datetime" json:"modify_time"`                // 更新时间
}

func (m *EtaVersionUpdateLog) TableName() string {
	return "eta_version_update_log"
}

// GetItemsByCondition 获取列表
func (m *EtaVersionUpdateLog) GetItemsByCondition(condition string, pars []interface{}, orderRule string) (items []*EtaVersionUpdateLog, err error) {
	if orderRule == "" {
		orderRule = "create_time DESC"
	}
	err = global.MYSQL["hz_crm"].Where(condition, pars...).Order(orderRule).Find(&items).Error
	return
}