|
@@ -21,30 +21,31 @@ const (
|
|
|
)
|
|
|
|
|
|
type Report struct {
|
|
|
- Id int
|
|
|
- OrgId int
|
|
|
- Source ReportSource
|
|
|
- Title string
|
|
|
- Abstract string
|
|
|
- Author string
|
|
|
- CoverSrc string
|
|
|
- Status ReportStatus
|
|
|
- SendStatus SendStatus
|
|
|
- PublishedTime string
|
|
|
- CreatedTime time.Time
|
|
|
- UpdatedTime time.Time
|
|
|
+ Id int `description:"id"`
|
|
|
+ OrgId int `description:"组织id"`
|
|
|
+ Source ReportSource `description:"来源"`
|
|
|
+ Title string `description:"标题"`
|
|
|
+ Abstract string `description:"摘要"`
|
|
|
+ Author string `description:"作者"`
|
|
|
+ CoverSrc int `description:"封面"`
|
|
|
+ Status ReportStatus `description:"状态"`
|
|
|
+ SendStatus SendStatus `description:"发送状态"`
|
|
|
+ PublishedTime string `description:"发布时间"`
|
|
|
+ CreatedTime time.Time `description:"创建时间"`
|
|
|
+ UpdatedTime time.Time `description:"更新时间"`
|
|
|
}
|
|
|
|
|
|
type ReportView struct {
|
|
|
- Id int
|
|
|
- OrgId int
|
|
|
- Source ReportSource
|
|
|
- Title string
|
|
|
- Abstract string
|
|
|
- Author string
|
|
|
- CoverSrc string
|
|
|
- SendStatus SendStatus
|
|
|
- PublishedTime string
|
|
|
+ Id int
|
|
|
+ OrgId int
|
|
|
+ Source ReportSource
|
|
|
+ Title string
|
|
|
+ Abstract string
|
|
|
+ Author string
|
|
|
+ CoverSrc string
|
|
|
+ PermissionNames string
|
|
|
+ SendStatus SendStatus
|
|
|
+ PublishedTime string
|
|
|
}
|
|
|
|
|
|
func (r *Report) ToView() (item *ReportView) {
|
|
@@ -55,7 +56,6 @@ func (r *Report) ToView() (item *ReportView) {
|
|
|
Title: r.Title,
|
|
|
Abstract: r.Abstract,
|
|
|
Author: r.Author,
|
|
|
- CoverSrc: r.CoverSrc,
|
|
|
SendStatus: r.SendStatus,
|
|
|
PublishedTime: r.PublishedTime,
|
|
|
}
|
|
@@ -112,6 +112,12 @@ func GetETAReportIdsByCondition(condition string, pars []interface{}) (ids []int
|
|
|
_, err = o.Raw(sql, pars).QueryRows(&ids)
|
|
|
return
|
|
|
}
|
|
|
+func GetETAReportById(id int) (classifyId int, err error) {
|
|
|
+ o := orm.NewOrmUsingDB("rddp")
|
|
|
+ sql := `SELECT COALESCE(NULLIF(classify_id_third,0),NULLIF(classify_id_second,0),classify_id_first) classify_id FROM report WHERE id =?`
|
|
|
+ err = o.Raw(sql, id).QueryRow(&classifyId)
|
|
|
+ return
|
|
|
+}
|
|
|
|
|
|
func GetETAReportIdByClassifyId(id int) (classifyId int, err error) {
|
|
|
o := orm.NewOrmUsingDB("rddp")
|