|
@@ -139,9 +139,9 @@ func PublishCancleReport(reportIds int, publishTimeNullFlag bool) (err error) {
|
|
|
o := orm.NewOrmUsingDB("rddp")
|
|
|
var sql string
|
|
|
if publishTimeNullFlag {
|
|
|
- sql = ` UPDATE report SET state=1, publish_time=null, pre_publish_time=null WHERE id =?`
|
|
|
+ sql = ` UPDATE report SET state=1, publish_time=null, pre_publish_time=null, pre_msg_send=0 WHERE id =?`
|
|
|
} else {
|
|
|
- sql = ` UPDATE report SET state=1, pre_publish_time=null WHERE id =?`
|
|
|
+ sql = ` UPDATE report SET state=1, pre_publish_time=null, pre_msg_send=0 WHERE id =?`
|
|
|
}
|
|
|
_, err = o.Raw(sql, reportIds).Exec()
|
|
|
return
|
|
@@ -261,6 +261,7 @@ type AddReq struct {
|
|
|
type PrePublishReq struct {
|
|
|
ReportId int `description:"报告id"`
|
|
|
PrePublishTime string `description:"预发布时间"`
|
|
|
+ PreMsgSend int `description:"定时发布成功后是否立即推送模版消息:0否,1是"`
|
|
|
}
|
|
|
|
|
|
type AddResp struct {
|
|
@@ -647,7 +648,7 @@ SELECT DISTINCT report_id FROM report_chapter WHERE publish_state = 2 AND (video
|
|
|
// 发布报告
|
|
|
func PublishReportById(reportId int, publishTime time.Time) (err error) {
|
|
|
o := orm.NewOrmUsingDB("rddp")
|
|
|
- sql := `UPDATE report SET state = 2, publish_time = ?, pre_publish_time=null, modify_time = NOW() WHERE id = ? `
|
|
|
+ sql := `UPDATE report SET state = 2, publish_time = ?, pre_publish_time=null, pre_msg_send=0, modify_time = NOW() WHERE id = ? `
|
|
|
_, err = o.Raw(sql, publishTime, reportId).Exec()
|
|
|
return
|
|
|
}
|
|
@@ -1014,9 +1015,9 @@ func ModifyReportMsgIsSendV2(reportId int) (err error) {
|
|
|
}
|
|
|
|
|
|
// SetPrePublishReportById 设置定时发布
|
|
|
-func SetPrePublishReportById(reportId int, prePublishTime string) (err error) {
|
|
|
+func SetPrePublishReportById(reportId int, prePublishTime string, preMsgSend int) (err error) {
|
|
|
o := orm.NewOrmUsingDB("rddp")
|
|
|
- sql := `UPDATE report SET pre_publish_time=? WHERE id = ? and state = 1 `
|
|
|
- _, err = o.Raw(sql, prePublishTime, reportId).Exec()
|
|
|
+ sql := `UPDATE report SET pre_publish_time=?, pre_msg_send=? WHERE id = ? and state = 1 `
|
|
|
+ _, err = o.Raw(sql, prePublishTime, preMsgSend, reportId).Exec()
|
|
|
return
|
|
|
}
|