xingzai 1 éve
szülő
commit
3889bd6da5
3 módosított fájl, 20 hozzáadás és 7 törlés
  1. 13 6
      controllers/activity.go
  2. 5 1
      models/activity.go
  3. 2 0
      models/resource_data.go

+ 13 - 6
controllers/activity.go

@@ -331,13 +331,19 @@ func (this *ActivityController) ActivityListNew() {
 		}
 		conditioninit += ` AND art.activity_id IN ( ` + videoOrVoiceActivityIds + `) `
 	}
-	//是否为外部资源
-	if isExternalLabel == 1 {
-		conditioninit += ` AND art.is_external_label = 1 `
-	}
-	if isResearchPoints == 1 {
-		conditioninit += ` AND art.is_research_points = 1 `
+	if isExternalLabel == 1 && isResearchPoints == 1 {
+		conditioninit += ` AND ( art.is_external_label = 1  OR art.is_research_points = 1 )`
+	} else {
+		//是否为外部资源
+		if isExternalLabel == 1 {
+			conditioninit += ` AND art.is_external_label = 1 `
+		}
+		// 是否为研选扣点
+		if isResearchPoints == 1 {
+			conditioninit += ` AND art.is_research_points = 1 `
+		}
 	}
+
 	condition = ""
 	//活动可见限制
 	//conditionActivity, err := services.GetActivityonditionList(user, activityTypeId, chartPermissionIds, whichDay, activeState, label, 0, source, keyWord, playBack, 1)
@@ -1927,6 +1933,7 @@ func (this *ActivityController) ActivityListSearch() {
 		item.IsYidongConduct = v.IsYidongConduct
 		item.IsCanOutboundCall = v.IsCanOutboundCall
 		item.IsLimitPeople = v.IsLimitPeople
+		item.IsResearchPoints = v.IsResearchPoints
 		// 判断是否属于研选类型的活动
 		if strings.Contains(v.ChartPermissionName, utils.CHART_PERMISSION_NAME_YANXUAN) {
 			item.IsResearch = true

+ 5 - 1
models/activity.go

@@ -260,7 +260,7 @@ type CygxActivityResp struct {
 // 列表
 func GetCygxActivityList(condition string, pars []interface{}, sortTime string, startSize, pageSize int) (items []*CygxActivity, err error) {
 	o := orm.NewOrm()
-	sql := `SELECT	activity_id,city, label,temporary_label,is_show_subject_name, MAX( art.activity_time ) AS timesort, MIn( art.activity_time ) AS mintimesort , yidong_activity_id , activity_type_id,is_external_label
+	sql := `SELECT	activity_id,city, label,temporary_label,is_show_subject_name, MAX( art.activity_time ) AS timesort, MIn( art.activity_time ) AS mintimesort , yidong_activity_id , activity_type_id,is_external_label,is_research_points
 		FROM cygx_activity as art WHERE 1= 1 `
 	if condition != "" {
 		sql += condition
@@ -421,6 +421,7 @@ func GetActivitySpecialSearcheList(condition string, pars []interface{}, conditi
             art.is_yidong_conduct,
             art.is_can_outbound_call,
             art.city,
+            art.is_research_points,
 			art.activity_time 
 		FROM
 			cygx_activity AS art
@@ -454,6 +455,7 @@ func GetActivitySpecialSearcheList(condition string, pars []interface{}, conditi
 			"",
 			"",
 			"",
+			"",
 			art.activity_time 
 		FROM
 			cygx_activity_special AS art
@@ -549,6 +551,7 @@ func GetScheduleAndSpecilList(condition string, pars []interface{}, conditionSpe
 			art.city AS city,
 			art.is_yidong_conduct,
 			art.is_can_outbound_call,
+			art.is_research_points,
 			art.host 
 		FROM
 			cygx_activity AS art
@@ -585,6 +588,7 @@ func GetScheduleAndSpecilList(condition string, pars []interface{}, conditionSpe
 			art.city,
 			"",
 			"",
+			"",
 			art.host 
 		FROM
 			cygx_activity_special AS art

+ 2 - 0
models/resource_data.go

@@ -68,6 +68,8 @@ type CygxResourceDataResp struct {
 	IsCanOutboundCall       int                        `description:"是否提供外呼 1:是 、0:否"`
 	TencentConferenceNumber string                     `description:"腾讯会议号"`
 	IsResearchSpecial       bool                       `description:"是否属于特殊的研选"`
+	IsExternalLabel         bool                       `description:"是否为外部资源"`
+	IsResearchPoints        bool                       `description:"是否为研选扣点"`
 }
 
 type HomeResourceDataListResp struct {