Sfoglia il codice sorgente

点击作者名称进入报告列表页不展示该作者编写的纪要

xingzai 3 anni fa
parent
commit
03d463a228
4 ha cambiato i file con 8 aggiunte e 7 eliminazioni
  1. 1 1
      controllers/article.go
  2. 3 4
      controllers/report.go
  3. 2 0
      models/article_department.go
  4. 2 2
      models/user.go

+ 1 - 1
controllers/article.go

@@ -206,7 +206,7 @@ func (this *ArticleController) Detail() {
 			br.ErrMsg = "获取销售数据失败,Err:" + err.Error() + strconv.Itoa(uid) + ";articleId" + strconv.Itoa(articleId)
 			return
 		}
-		if detail.ArticleId >= utils.SummaryArticleId {
+		if detail.ArticleId >= utils.SummaryArticleId && strings.Contains(detail.SellerAndMobile, "-") {
 			strnum := strings.Index(detail.SellerAndMobile, "-")
 			detail.SellerAndMobile = detail.SellerAndMobile[0:strnum]
 			if strnum > 0 {

+ 3 - 4
controllers/report.go

@@ -638,7 +638,7 @@ func (this *ReportController) IndustryListByDepartment() {
 	chartPermissionId, _ := this.GetInt("ChartPermissionId")
 	var startSize int
 	var condition string
-	condition = ` AND a.publish_status=1  AND m.chart_permission_id =` + strconv.Itoa(chartPermissionId)
+	condition = `	AND a.is_report = 1  AND a.publish_status=1  AND m.chart_permission_id =` + strconv.Itoa(chartPermissionId)
 	if pageSize <= 0 {
 		pageSize = utils.PageSize20
 	}
@@ -680,7 +680,6 @@ func (this *ReportController) IndustryListByDepartment() {
 		}
 		for k2, v2 := range artList {
 			subjectNames, err := models.GetSubjectNames(v2.ArticleId)
-
 			if err != nil {
 				br.Msg = "获取失败" + strconv.Itoa(v2.ArticleId)
 				br.ErrMsg = "获取失败,Err:" + err.Error()
@@ -877,7 +876,6 @@ func (this *ReportController) ReportList() {
 		condition += ` AND art.department_id = ` + strconv.Itoa(departmentId)
 	}
 	if industrialManagementId > 0 {
-
 		condition += ` AND m.industrial_management_id = ` + strconv.Itoa(industrialManagementId)
 	}
 	if articleId > 0 {
@@ -897,7 +895,7 @@ func (this *ReportController) ReportList() {
 		return
 	}
 	page = paging.GetPaging(currentIndex, pageSize, total)
-	condition += ` 	GROUP BY art.article_id ORDER BY art.publish_date DESC`
+	condition += ` AND art.is_report =1 	GROUP BY art.article_id ORDER BY art.publish_date DESC`
 	list, err := models.IndustrialToArticleWhichDepartment(condition, pars, uid, startSize, pageSize)
 	if err != nil {
 		br.Msg = "获取失败"
@@ -933,6 +931,7 @@ func (this *ReportController) ReportList() {
 		subjectNamesNew = strings.TrimRight(subjectNamesNew, "/")
 		list[k].SubjectName = subjectNamesNew
 		list[k].IndustryName = industryName + "-" + subjectNamesNew
+		resp.IndustryName = industryName
 	}
 	resp.List = list
 	resp.Paging = page

+ 2 - 0
models/article_department.go

@@ -117,6 +117,8 @@ func GetIndustrialSubjectByDepartmentNew(industrialManagementId int) (items []*I
 			WHERE 1 = 1 
 			AND m.chart_permission_id = ?
 			AND a.publish_status=1 
+			AND a.subject_ids != ''
+			AND a.is_report=1 
 			GROUP BY
 			m.industrial_management_id 
 			ORDER BY art_time DESC LIMIT 6 `

+ 2 - 2
models/user.go

@@ -136,13 +136,13 @@ type CheckStatusResp struct {
 }
 
 func GetArticleUserCollectCount(userId int) (count int, err error) {
-	sql := `SELECT COUNT(1) AS count FROM cygx_article_collect AS a WHERE a.user_id=? `
+	sql := `SELECT COUNT(1) AS count FROM cygx_article_collect AS a INNER JOIN cygx_article as art ON art.article_id = a.article_id WHERE a.user_id=?  `
 	err = orm.NewOrm().Raw(sql, userId).QueryRow(&count)
 	return
 }
 
 func GetArticleUserCollectList(startSize, pageSize, userId int) (items []*ArticleCollectList, err error) {
-	sql := `SELECT a.* FROM cygx_article_collect AS a
+	sql := `SELECT a.* FROM cygx_article_collect AS a INNER JOIN cygx_article as art ON art.article_id = a.article_id
 			WHERE a.user_id=? 
            ORDER BY a.create_time DESC LIMIT ?,? `
 	_, err = orm.NewOrm().Raw(sql, userId, startSize, pageSize).QueryRows(&items)