xingzai 1 سال پیش
والد
کامیت
9506114ecc
3فایلهای تغییر یافته به همراه23 افزوده شده و 2 حذف شده
  1. 4 1
      controllers/report_selection.go
  2. 1 0
      models/report_selection.go
  3. 18 1
      models/report_selection_log_apply.go

+ 4 - 1
controllers/report_selection.go

@@ -131,7 +131,10 @@ func (this *ReportSelectionController) Detail() {
 						br.ErrMsg = "获取信息失败,Err:" + err.Error()
 						return
 					}
-					listSonLog[k2].OverviewArticleId = articleStockMap[v2.SubjectName]
+					//后台如果勾了隐藏那么这里就不展示  V11.3  2023-08-17
+					if listSonLog[k2].IsShowOverviewArticle == 1 {
+						listSonLog[k2].OverviewArticleId = articleStockMap[v2.SubjectName]
+					}
 					listSonLog[k2].List = listIndustrial
 					listSonLog[k2].IsShowApplyButton = true
 					if v2.Label != "" {

+ 1 - 0
models/report_selection.go

@@ -79,6 +79,7 @@ type CygxReportSelectionLogDetail struct {
 	CompanyLabel           []string `description:"公司标签"`
 	Label                  string   `description:"公司标签"`
 	OverviewArticleId      int      `description:"综述报告Id"`
+	IsShowOverviewArticle  int      `description:"是否展示综述报告 1展示,0隐藏"`
 	List                   []*IndustriaReportSelection
 }
 type IndustriaReportSelection struct {

+ 18 - 1
models/report_selection_log_apply.go

@@ -29,7 +29,24 @@ type CygxReportSelectionLogApplyReq struct {
 
 // 添加信息
 func AddCygxReportSelectionLogApply(item *CygxReportSelectionLogApply) (lastId int64, err error) {
-	o := orm.NewOrm()
+	o, err := orm.NewOrm().Begin()
+	if err != nil {
+		return
+	}
+	defer func() {
+		if err == nil {
+			o.Commit()
+		} else {
+			o.Rollback()
+		}
+	}()
+
+	//更新申请数量
+	sql := ` UPDATE cygx_report_selection SET  apply_total= 1 + apply_total WHERE  article_id  = ?`
+	_, err = o.Raw(sql, item.ArticleId).Exec()
+	if err != nil {
+		return
+	}
 	lastId, err = o.Insert(item)
 	return
 }