1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- 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.NewOrmUsingDB("rddp")
- 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:"研报分享图片"`
- Hz int
- }
- func UpdateEnglishReportCounts(reportCode string) (err error) {
- o := orm.NewOrmUsingDB("rddp")
- 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.NewOrmUsingDB("rddp")
- 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.NewOrmUsingDB("rddp_trial")
- sql := `SELECT * FROM english_report WHERE report_code=?`
- err = o.Raw(sql, reportCode).QueryRow(&item)
- return
- }
- func UpdateTrialEnglishReportCounts(reportCode string) (err error) {
- o := orm.NewOrmUsingDB("rddp_trial")
- 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.NewOrmUsingDB("rddp_trial")
- sql := `UPDATE english_report SET pv_email = pv_email+1 WHERE report_code = ? `
- _, err = o.Raw(sql, reportCode).Exec()
- return
- }
|