浏览代码

Merge branch 'cygx_12.2.1' of http://8.136.199.33:3000/hongze/hongze_cygx into debug

xingzai 1 年之前
父节点
当前提交
87d6007707
共有 1 个文件被更改,包括 8 次插入6 次删除
  1. 8 6
      services/activity_special.go

+ 8 - 6
services/activity_special.go

@@ -733,6 +733,9 @@ func GetActivitySpecialSearcheList(user *models.WxUserItem, condition string, st
 	var conditionSpecil string
 	var conditionSpecil string
 	var pars, parsSpecil []interface{}
 	var pars, parsSpecil []interface{}
 	keyword := keywords
 	keyword := keywords
+	if user.UserId == 0 {
+		conditionSpecil += `  AND  art.activity_id	= 0 ` // 未登录的用户不查看专项调研活动 v12.2.1
+	}
 	if keywords != "" {
 	if keywords != "" {
 		keywords = "%" + keywords + "%"
 		keywords = "%" + keywords + "%"
 		conditionSpecil += ` AND art.days > 0 AND (art.research_theme LIKE ? OR art.label LIKE ? OR art.industrial_name LIKE ? OR art.industrial_subject_name LIKE ? ) `
 		conditionSpecil += ` AND art.days > 0 AND (art.research_theme LIKE ? OR art.label LIKE ? OR art.industrial_name LIKE ? OR art.industrial_subject_name LIKE ? ) `
@@ -1390,7 +1393,6 @@ func GetChartPermissionSpecialSurplusByCompany(companyId int) (userType int, tri
 	return
 	return
 }
 }
 
 
-
 // 清零初始化用-去掉了正式用户的判断
 // 清零初始化用-去掉了正式用户的判断
 func GetChartPermissionSpecialSurplusByCompanyForInit(companyId int) (userType int, tripRemaining int, mapChartName map[string]int, err error) {
 func GetChartPermissionSpecialSurplusByCompanyForInit(companyId int) (userType int, tripRemaining int, mapChartName map[string]int, err error) {
 	companyDetail, e := models.GetCompanyDetailByIdGroup(companyId)
 	companyDetail, e := models.GetCompanyDetailByIdGroup(companyId)
@@ -1405,7 +1407,7 @@ func GetChartPermissionSpecialSurplusByCompanyForInit(companyId int) (userType i
 	//}
 	//}
 
 
 	//chartMap := map[int]string{utils.YI_YAO_ID:utils.YI_YAO_NAME, utils.XIAO_FEI_ID:utils.XIAO_FEI_NAME, utils.KE_JI_ID:utils.KE_JI_NAME, utils.ZHI_ZAO_ID:utils.ZHI_ZAO_NAME}
 	//chartMap := map[int]string{utils.YI_YAO_ID:utils.YI_YAO_NAME, utils.XIAO_FEI_ID:utils.XIAO_FEI_NAME, utils.KE_JI_ID:utils.KE_JI_NAME, utils.ZHI_ZAO_ID:utils.ZHI_ZAO_NAME}
-	chartNumMap := map[int]int{utils.YI_YAO_ID:0, utils.XIAO_FEI_ID:0, utils.KE_JI_ID:0, utils.ZHI_ZAO_ID:0}
+	chartNumMap := map[int]int{utils.YI_YAO_ID: 0, utils.XIAO_FEI_ID: 0, utils.KE_JI_ID: 0, utils.ZHI_ZAO_ID: 0}
 	//var packageType int
 	//var packageType int
 	userType, _, _ = GetUserType(companyId)
 	userType, _, _ = GetUserType(companyId)
 	var condition string
 	var condition string
@@ -1490,7 +1492,7 @@ func GetChartPermissionSpecialSurplusByCompanyForInit(companyId int) (userType i
 			mapPermissionNameTrip[v.ChartPermissionName] += v.BillDetailed
 			mapPermissionNameTrip[v.ChartPermissionName] += v.BillDetailed
 		}
 		}
 		for _, v := range chartList {
 		for _, v := range chartList {
-			if _, ok := chartNumMap[v.ChartPermissionId]; ok{
+			if _, ok := chartNumMap[v.ChartPermissionId]; ok {
 				//如果是升级则加点
 				//如果是升级则加点
 				if _, ok := mapUpgradeId[v.ChartPermissionId]; ok {
 				if _, ok := mapUpgradeId[v.ChartPermissionId]; ok {
 					mapChartName[v.PermissionName] = 5 + mapPermissionNameTrip[v.PermissionName]
 					mapChartName[v.PermissionName] = 5 + mapPermissionNameTrip[v.PermissionName]
@@ -1527,7 +1529,7 @@ func GetChartPermissionSpecialSurplusByCompanyForInitTotal(companyId int) (userT
 	//}
 	//}
 
 
 	//chartMap := map[int]string{utils.YI_YAO_ID:utils.YI_YAO_NAME, utils.XIAO_FEI_ID:utils.XIAO_FEI_NAME, utils.KE_JI_ID:utils.KE_JI_NAME, utils.ZHI_ZAO_ID:utils.ZHI_ZAO_NAME}
 	//chartMap := map[int]string{utils.YI_YAO_ID:utils.YI_YAO_NAME, utils.XIAO_FEI_ID:utils.XIAO_FEI_NAME, utils.KE_JI_ID:utils.KE_JI_NAME, utils.ZHI_ZAO_ID:utils.ZHI_ZAO_NAME}
-	chartNumMap := map[int]int{utils.YI_YAO_ID:0, utils.XIAO_FEI_ID:0, utils.KE_JI_ID:0, utils.ZHI_ZAO_ID:0}
+	chartNumMap := map[int]int{utils.YI_YAO_ID: 0, utils.XIAO_FEI_ID: 0, utils.KE_JI_ID: 0, utils.ZHI_ZAO_ID: 0}
 	//var packageType int
 	//var packageType int
 	userType, _, _ = GetUserType(companyId)
 	userType, _, _ = GetUserType(companyId)
 	var condition string
 	var condition string
@@ -1612,7 +1614,7 @@ func GetChartPermissionSpecialSurplusByCompanyForInitTotal(companyId int) (userT
 			mapPermissionNameTrip[v.ChartPermissionName] += v.BillDetailed
 			mapPermissionNameTrip[v.ChartPermissionName] += v.BillDetailed
 		}
 		}
 		for _, v := range chartList {
 		for _, v := range chartList {
-			if _, ok := chartNumMap[v.ChartPermissionId]; ok{
+			if _, ok := chartNumMap[v.ChartPermissionId]; ok {
 				//如果是升级则加点
 				//如果是升级则加点
 				if _, ok := mapUpgradeId[v.ChartPermissionId]; ok {
 				if _, ok := mapUpgradeId[v.ChartPermissionId]; ok {
 					mapChartName[v.PermissionName] = 5 + mapPermissionNameTrip[v.PermissionName]
 					mapChartName[v.PermissionName] = 5 + mapPermissionNameTrip[v.PermissionName]
@@ -1633,4 +1635,4 @@ func GetChartPermissionSpecialSurplusByCompanyForInitTotal(companyId int) (userT
 	}
 	}
 
 
 	return
 	return
-}
+}