package models import ( "eta_gn/eta_report/global" ) type EnglishReportDetail struct { Id int `gorm:"primaryKey;autoIncrement;column:id"` AddType int `gorm:"column:add_type" description:"新增方式:1:新增报告,2:继承报告"` ClassifyIdFirst int `gorm:"column:classify_id_first" description:"一级分类id"` ClassifyNameFirst string `gorm:"column:classify_name_first" description:"一级分类名称"` ClassifyIdSecond int `gorm:"column:classify_id_second" description:"二级分类id"` ClassifyNameSecond string `gorm:"column:classify_name_second" description:"二级分类名称"` Title string `gorm:"column:title" description:"标题"` Abstract string `gorm:"column:abstract" description:"摘要"` Author string `gorm:"column:author" description:"作者"` Frequency string `gorm:"column:frequency" description:"频度"` CreateTime string `gorm:"column:create_time" description:"创建时间"` ModifyTime string `gorm:"column:modify_time" description:"修改时间"` State int `gorm:"column:state" description:"1:未发布,2:已发布"` PublishTime string `gorm:"column:publish_time" description:"发布时间"` Stage int `gorm:"column:stage" description:"期数"` MsgIsSend int `gorm:"column:msg_is_send" description:"消息是否已发送,0:否,1:是"` Content string `gorm:"column:content" description:"内容"` VideoUrl string `gorm:"column:video_url" description:"音频文件URL"` VideoName string `gorm:"column:video_name" description:"音频文件名称"` VideoPlaySeconds string `gorm:"column:video_play_seconds" description:"音频播放时长"` ContentSub string `gorm:"column:content_sub" description:"内容前两个章节"` ThsMsgIsSend int `gorm:"column:ths_msg_is_send" description:"客户群消息是否已发送,0:否,1:是"` HasChapter int `gorm:"column:has_chapter" description:"是否有章节 0-否 1-是"` ChapterType string `gorm:"column:chapter_type" description:"章节类型 day-晨报 week-周报"` Overview string `gorm:"column:overview" description:"英文概述部分"` } func GetEnglishReportByCode(reportCode string) (item *EnglishReportDetail, err error) { sql := `SELECT * FROM english_report WHERE report_code=?` err = global.DEFAULT_DmSQL.Raw(sql, reportCode).Scan(&item).Error return } type EnglishReportShareDetailResp struct { Report *EnglishReportDetail `description:"报告"` H5ShareEnName string `description:"研报分享抬头"` H5ReportShareImg string `description:"研报分享图片"` WatermarkChart string `description:"图表是否需要水印"` WatermarkReport string `description:"报告是否需要水印"` Hz int DisclaimerEn string `description:"免责声明"` ReportLogo string `description:"报告logo"` } func UpdateEnglishReportCounts(reportCode string) (err error) { sql := `UPDATE english_report SET pv = pv+1 WHERE report_code = ? ` err = global.DEFAULT_DmSQL.Exec(sql, reportCode).Error return } func UpdateEnglishReportEmailCounts(reportCode string) (err error) { sql := `UPDATE english_report SET pv_email = pv_email+1 WHERE report_code = ? ` err = global.DEFAULT_DmSQL.Exec(sql, reportCode).Error return } func GetTrialEnglishReportByCode(reportCode string) (item *EnglishReportDetail, err error) { sql := `SELECT * FROM english_report WHERE report_code=?` err = global.DEFAULT_DmSQL.Raw(sql, reportCode).Scan(&item).Error return } func UpdateTrialEnglishReportCounts(reportCode string) (err error) { sql := `UPDATE english_report SET pv = pv+1 WHERE report_code = ? ` err = global.DEFAULT_DmSQL.Exec(sql, reportCode).Error return } func UpdateTrialEnglishReportEmailCounts(reportCode string) (err error) { sql := `UPDATE english_report SET pv_email = pv_email+1 WHERE report_code = ? ` err = global.DEFAULT_DmSQL.Exec(sql, reportCode).Error return }