|
@@ -541,6 +541,12 @@ func (this *ReportController) Fllow() {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
resp := new(models.CygxIndustryFllowResp)
|
|
resp := new(models.CygxIndustryFllowResp)
|
|
|
|
+
|
|
|
|
+ countUser, err := models.GetArticleDepartmentFollowByUid(uid)
|
|
|
|
+
|
|
|
|
+ if countUser == 0 {
|
|
|
|
+ resp.GoFollow = true
|
|
|
|
+ }
|
|
if count == 0 {
|
|
if count == 0 {
|
|
item := new(models.CygxIndustryFllow)
|
|
item := new(models.CygxIndustryFllow)
|
|
item.IndustrialManagementId = industrialManagementId
|
|
item.IndustrialManagementId = industrialManagementId
|
|
@@ -558,7 +564,6 @@ func (this *ReportController) Fllow() {
|
|
br.ErrMsg = "操作失败,Err:" + err.Error()
|
|
br.ErrMsg = "操作失败,Err:" + err.Error()
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- resp.GoFollow = true
|
|
|
|
resp.Status = 1
|
|
resp.Status = 1
|
|
} else {
|
|
} else {
|
|
var doType int
|
|
var doType int
|
|
@@ -629,7 +634,7 @@ func (this *ReportController) IndustryListByDepartment() {
|
|
total, err := models.GetArticleDepartmentCount(condition)
|
|
total, err := models.GetArticleDepartmentCount(condition)
|
|
page := paging.GetPaging(currentIndex, pageSize, total)
|
|
page := paging.GetPaging(currentIndex, pageSize, total)
|
|
//获取作者信息,并排序
|
|
//获取作者信息,并排序
|
|
- list, err := models.GetCygxArticleDepartmentList(startSize, pageSize, condition)
|
|
|
|
|
|
+ list, err := models.GetCygxArticleDepartmentList(startSize, pageSize, condition, uid)
|
|
if err != nil {
|
|
if err != nil {
|
|
br.Msg = "获取信息失败"
|
|
br.Msg = "获取信息失败"
|
|
br.ErrMsg = "获取品种信息失败,Err:" + err.Error()
|
|
br.ErrMsg = "获取品种信息失败,Err:" + err.Error()
|
|
@@ -699,6 +704,7 @@ func (this *ReportController) FllowDepartment() {
|
|
br.ErrMsg = "作者ID不存在:" + strconv.Itoa(departmentId)
|
|
br.ErrMsg = "作者ID不存在:" + strconv.Itoa(departmentId)
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
+ countUser, err := models.GetArticleDepartmentFollowByUid(uid)
|
|
count, err := models.GetArticleDepartmentFollow(uid, departmentId, condition)
|
|
count, err := models.GetArticleDepartmentFollow(uid, departmentId, condition)
|
|
if err != nil {
|
|
if err != nil {
|
|
br.Msg = "获取数据失败!"
|
|
br.Msg = "获取数据失败!"
|
|
@@ -706,6 +712,9 @@ func (this *ReportController) FllowDepartment() {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
resp := new(models.CygxArticleDepartmentFollowResp)
|
|
resp := new(models.CygxArticleDepartmentFollowResp)
|
|
|
|
+ if countUser == 0 {
|
|
|
|
+ resp.GoFollow = true
|
|
|
|
+ }
|
|
if count == 0 {
|
|
if count == 0 {
|
|
item := new(models.CygxArticleDepartmentFollow)
|
|
item := new(models.CygxArticleDepartmentFollow)
|
|
item.DepartmentId = departmentId
|
|
item.DepartmentId = departmentId
|
|
@@ -724,7 +733,6 @@ func (this *ReportController) FllowDepartment() {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
resp.Status = 1
|
|
resp.Status = 1
|
|
- resp.GoFollow = true
|
|
|
|
} else {
|
|
} else {
|
|
var doType int
|
|
var doType int
|
|
condition = ` AND type = 1`
|
|
condition = ` AND type = 1`
|