|
@@ -470,8 +470,10 @@ func (this *SmartReportController) Publish() {
|
|
|
item.State = state
|
|
|
item.ModifyTime = time.Now().Local()
|
|
|
if state == smart_report.SmartReportStatePublished {
|
|
|
- cols = append(cols, "PublishTime")
|
|
|
+ // 主动发布会清除掉预发布设置, 发布时间则取当前时间
|
|
|
+ cols = append(cols, "PublishTime", "PrePublishTime")
|
|
|
item.PublishTime = time.Now().Local()
|
|
|
+ item.PrePublishTime = time.Time{}
|
|
|
|
|
|
// 写入队列
|
|
|
var queue smart_report.Report2ImgQueueReq
|
|
@@ -480,11 +482,13 @@ func (this *SmartReportController) Publish() {
|
|
|
_ = utils.Rc.LPush(utils.CACHE_CREATE_REPORT_IMGPDF_QUEUE, queue)
|
|
|
}
|
|
|
|
|
|
- // 取消发布时同时清除掉Img和PDF的文件地址
|
|
|
+ // 取消发布时同时清除掉Img和PDF的文件地址, 发布时间以及预发布时间
|
|
|
if state == smart_report.SmartReportStateWaitPublish {
|
|
|
- cols = append(cols, "DetailImgUrl", "DetailPdfUrl")
|
|
|
+ cols = append(cols, "DetailImgUrl", "DetailPdfUrl", "PublishTime", "PrePublishTime")
|
|
|
item.DetailImgUrl = ""
|
|
|
item.DetailPdfUrl = ""
|
|
|
+ item.PublishTime = time.Time{}
|
|
|
+ item.PrePublishTime = time.Time{}
|
|
|
}
|
|
|
if e = item.Update(cols); e != nil {
|
|
|
br.Msg = "操作失败"
|