2 次代碼提交 749e3f9ff6 ... b309a07a4d

作者 SHA1 備註 提交日期
  hsun b309a07a4d Merge branch 'feature/report_chapter_1129' into debug 5 天之前
  hsun 2425f9be25 fix: 章节继承 5 天之前
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      models/report_chapter.go

+ 1 - 1
models/report_chapter.go

@@ -609,7 +609,7 @@ func GetCountReportChapterByCondition(condition string, pars []interface{}) (cou
 // GetNewestPreReportChapterByClassifyIdAndTypeId 获取分类下往期中最新发布的系统章节
 func GetNewestPreReportChapterByClassifyIdAndTypeId(classifyId, typeId int) (item *ReportChapter, err error) {
 	o := orm.NewOrmUsingDB("rddp")
-	sql := `SELECT * FROM report_chapter WHERE classify_id_first = ? AND type_id = ? AND publish_state = 2 ORDER BY publish_time DESC LIMIT 1`
+	sql := `SELECT a.* FROM report_chapter AS a JOIN report AS b ON a.report_id = b.id WHERE a.classify_id_first = ? AND a.type_id = ? AND a.publish_state = 2 AND b.state IN (2,6) ORDER BY a.publish_time DESC LIMIT 1`
 	err = o.Raw(sql, classifyId, typeId).QueryRow(&item)
 	return
 }