|
@@ -633,16 +633,12 @@ func (this *ReportController) IndustryListByDepartment() {
|
|
|
return
|
|
|
}
|
|
|
uid := user.UserId
|
|
|
-
|
|
|
- fmt.Println(uid)
|
|
|
pageSize, _ := this.GetInt("PageSize")
|
|
|
currentIndex, _ := this.GetInt("CurrentIndex")
|
|
|
chartPermissionId, _ := this.GetInt("ChartPermissionId")
|
|
|
var startSize int
|
|
|
var condition string
|
|
|
-
|
|
|
condition = ` AND m.chart_permission_id =` + strconv.Itoa(chartPermissionId)
|
|
|
-
|
|
|
if pageSize <= 0 {
|
|
|
pageSize = utils.PageSize20
|
|
|
}
|
|
@@ -652,6 +648,22 @@ func (this *ReportController) IndustryListByDepartment() {
|
|
|
startSize = paging.StartIndex(currentIndex, pageSize)
|
|
|
total, err := models.GetArticleDepartmentCount(condition)
|
|
|
page := paging.GetPaging(currentIndex, pageSize, total)
|
|
|
+ resp := new(models.CygxArticleDepartmentList)
|
|
|
+ userType, _, err := services.GetUserType(user.CompanyId)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取信息失败"
|
|
|
+ br.ErrMsg = "获取用户信息失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if userType == 1 {
|
|
|
+ resp.Paging = page
|
|
|
+ br.Ret = 200
|
|
|
+ br.Success = true
|
|
|
+ br.Msg = "获取成功"
|
|
|
+ br.Data = resp
|
|
|
+ return
|
|
|
+ }
|
|
|
+ resp.HaveResearch = true
|
|
|
//获取作者信息,并排序
|
|
|
list, err := models.GetCygxArticleDepartmentList(startSize, pageSize, condition, uid)
|
|
|
if err != nil {
|
|
@@ -690,7 +702,7 @@ func (this *ReportController) IndustryListByDepartment() {
|
|
|
list[k].IsMyFollow = true
|
|
|
}
|
|
|
}
|
|
|
- resp := new(models.CygxArticleDepartmentList)
|
|
|
+
|
|
|
resp.ListnNew, err = models.GetIndustrialSubjectByDepartmentNew(chartPermissionId)
|
|
|
if err != nil {
|
|
|
br.Msg = "获取信息失败"
|
|
@@ -840,15 +852,28 @@ func (this *ReportController) ReportList() {
|
|
|
var total int
|
|
|
resp := new(models.ReportArticleWhichIndustrialRepList)
|
|
|
page := paging.GetPaging(currentIndex, pageSize, total)
|
|
|
-
|
|
|
+ userType, _, err := services.GetUserType(user.CompanyId)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取信息失败"
|
|
|
+ br.ErrMsg = "获取用户信息失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if userType == 1 {
|
|
|
+ resp.Paging = page
|
|
|
+ br.Ret = 200
|
|
|
+ br.Success = true
|
|
|
+ br.Msg = "获取成功"
|
|
|
+ br.Data = resp
|
|
|
+ return
|
|
|
+ }
|
|
|
+ resp.HaveResearch = true
|
|
|
if departmentId > 0 {
|
|
|
condition += ` AND art.department_id = ` + strconv.Itoa(departmentId)
|
|
|
}
|
|
|
-
|
|
|
if industrialManagementId > 0 {
|
|
|
condition += ` AND m.industrial_management_id = ` + strconv.Itoa(industrialManagementId)
|
|
|
}
|
|
|
- total, err := models.GetWhichDepartmentCount(condition)
|
|
|
+ total, err = models.GetWhichDepartmentCount(condition)
|
|
|
if err != nil {
|
|
|
br.Msg = "获取信息失败"
|
|
|
br.ErrMsg = "获取帖子总数失败,Err:" + err.Error()
|