123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- package models
- import "github.com/beego/beego/v2/client/orm"
- type EnglishReportDetail struct {
- Id int `orm:"column(id)" description:"报告Id"`
- AddType int `description:"新增方式:1:新增报告,2:继承报告"`
- ClassifyIdFirst int `description:"一级分类id"`
- ClassifyNameFirst string `description:"一级分类名称"`
- ClassifyIdSecond int `description:"二级分类id"`
- ClassifyNameSecond string `description:"二级分类名称"`
- Title string `description:"标题"`
- Abstract string `description:"摘要"`
- Author string `description:"作者"`
- Frequency string `description:"频度"`
- CreateTime string `description:"创建时间"`
- ModifyTime string `description:"修改时间"`
- State int `description:"1:未发布,2:已发布"`
- PublishTime string `description:"发布时间"`
- Stage int `description:"期数"`
- MsgIsSend int `description:"消息是否已发送,0:否,1:是"`
- Content string `description:"内容"`
- VideoUrl string `description:"音频文件URL"`
- VideoName string `description:"音频文件名称"`
- VideoPlaySeconds string `description:"音频播放时长"`
- ContentSub string `description:"内容前两个章节"`
- ThsMsgIsSend int `description:"客户群消息是否已发送,0:否,1:是"`
- HasChapter int `description:"是否有章节 0-否 1-是"`
- ChapterType string `description:"章节类型 day-晨报 week-周报"`
- Overview string `description:"英文概述部分"`
- }
- func GetEnglishReportByCode(reportCode string) (item *EnglishReportDetail, err error) {
- o := orm.NewOrm()
- sql := `SELECT * FROM english_report WHERE report_code=?`
- err = o.Raw(sql, reportCode).QueryRow(&item)
- 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) {
- o := orm.NewOrm()
- sql := `UPDATE english_report SET pv = pv+1 WHERE report_code = ? `
- _, err = o.Raw(sql, reportCode).Exec()
- return
- }
- func UpdateEnglishReportEmailCounts(reportCode string) (err error) {
- o := orm.NewOrm()
- sql := `UPDATE english_report SET pv_email = pv_email+1 WHERE report_code = ? `
- _, err = o.Raw(sql, reportCode).Exec()
- return
- }
- func GetTrialEnglishReportByCode(reportCode string) (item *EnglishReportDetail, err error) {
- o := orm.NewOrm()
- sql := `SELECT * FROM english_report WHERE report_code=?`
- err = o.Raw(sql, reportCode).QueryRow(&item)
- return
- }
- func UpdateTrialEnglishReportCounts(reportCode string) (err error) {
- o := orm.NewOrm()
- sql := `UPDATE english_report SET pv = pv+1 WHERE report_code = ? `
- _, err = o.Raw(sql, reportCode).Exec()
- return
- }
- func UpdateTrialEnglishReportEmailCounts(reportCode string) (err error) {
- o := orm.NewOrm()
- sql := `UPDATE english_report SET pv_email = pv_email+1 WHERE report_code = ? `
- _, err = o.Raw(sql, reportCode).Exec()
- return
- }
|