package models

import (
	"time"

	"github.com/beego/beego/v2/client/orm"
)

type ReportAuthor struct {
	Id           int       `orm:"column(id)" description:"报告作者ID"`
	ReportAuthor string    `description:"报告作者名称"`
	AuthorType   int       `description:"类型,1:中文;2:英文"`
	Enable       int       `description:"是否启用,0:禁用,1:启用"`
	IsDelete     int       `description:"是否删除,0:未删除,1:已删除"`
	CreateTime   time.Time `description:"创建时间"`
	ModifyTime   time.Time `description:"更新时间"`
}

// GetReportAuthorList 获取报告作者列表
func GetReportAuthorList() (items []*ReportAuthor, err error) {
	o := orm.NewOrmUsingDB("rddp")

	sql := ` SELECT * FROM report_author WHERE is_delete=0 AND enable=1 ORDER BY id desc  `
	_, err = o.Raw(sql).QueryRows(&items)
	return
}