xingzai vor 2 Jahren
Ursprung
Commit
651f7311df
4 geänderte Dateien mit 43 neuen und 37 gelöschten Zeilen
  1. 0 1
      controllers/activity.go
  2. 1 1
      models/company_activity_trip.go
  3. 5 0
      services/activity.go
  4. 37 35
      services/activity_special.go

+ 0 - 1
controllers/activity.go

@@ -180,7 +180,6 @@ func (this *ActivityController) ActivityListNew() {
 		br.ErrMsg = "获取失败,Err:" + err.Error()
 		br.ErrMsg = "获取失败,Err:" + err.Error()
 		return
 		return
 	}
 	}
-
 	var conditionOrder string
 	var conditionOrder string
 	if activeState == "2" || activeState == "3" {
 	if activeState == "2" || activeState == "3" {
 		conditionOrder = ` ORDER BY art.activity_time DESC  `
 		conditionOrder = ` ORDER BY art.activity_time DESC  `

+ 1 - 1
models/company_activity_trip.go

@@ -70,7 +70,7 @@ func GetCompanyPermissionByUserZhengShiTrip(companyId int) (permission string, e
 			AND c.is_suspend=0
 			AND c.is_suspend=0
             AND b.cygx_auth=1
             AND b.cygx_auth=1
 			AND a.is_upgrade = 1 
 			AND a.is_upgrade = 1 
-			AND c.status IN('正式')  `
+			AND ( a.is_upgrade = 1 AND c.STATUS = '正式' OR c.STATUS = '永续' ) `
 	o := orm.NewOrm()
 	o := orm.NewOrm()
 	err = o.Raw(sql, companyId).QueryRow(&permission)
 	err = o.Raw(sql, companyId).QueryRow(&permission)
 	return
 	return

+ 5 - 0
services/activity.go

@@ -207,6 +207,8 @@ func GetActivityonditionList(user *models.WxUserItem, activityTypeId, chartPermi
 		if len(ativityVIdArry) > 0 {
 		if len(ativityVIdArry) > 0 {
 			ativityVIdstr := strings.Join(ativityVIdArry, ",")
 			ativityVIdstr := strings.Join(ativityVIdArry, ",")
 			condition += ` AND art.activity_id IN  (` + ativityVIdstr + `) `
 			condition += ` AND art.activity_id IN  (` + ativityVIdstr + `) `
+		} else {
+			condition += ` AND art.activity_id = 0  `
 		}
 		}
 	}
 	}
 
 
@@ -233,6 +235,9 @@ func GetActivityonditionList(user *models.WxUserItem, activityTypeId, chartPermi
 	if conditionHangYe != "" {
 	if conditionHangYe != "" {
 		conditionOr += ` OR (  art.is_limit_people = 1 AND ` + conditionHangYe + condition + ` ) `
 		conditionOr += ` OR (  art.is_limit_people = 1 AND ` + conditionHangYe + condition + ` ) `
 	}
 	}
+	fmt.Println(conditionShengji)
+	fmt.Println(conditionZhengshi)
+	fmt.Println(conditionHangYe)
 
 
 	conditionHz = condition
 	conditionHz = condition
 
 

+ 37 - 35
services/activity_special.go

@@ -132,7 +132,9 @@ func ActivityLabelSpecialUserSql(user *models.WxUserItem) (conditionShengji, con
 		permissionZhengShiStr = strings.Replace(permissionZhengShiStr, "(客观)", "", -1)
 		permissionZhengShiStr = strings.Replace(permissionZhengShiStr, "(客观)", "", -1)
 		permissionZhengShiStr = strings.TrimRight(permissionZhengShiStr, ",")
 		permissionZhengShiStr = strings.TrimRight(permissionZhengShiStr, ",")
 		permissionZhengShiStr += `, '宏观'`
 		permissionZhengShiStr += `, '宏观'`
-		conditionHangYe = `  art.customer_type_ids LIKE '%3%'	   AND art.chart_permission_name    IN (` + permissionZhengShiStr + `)`
+		if userType != 1 && userType != 2 && userType != 10 {
+			conditionHangYe = `  art.customer_type_ids LIKE '%3%'	   AND art.chart_permission_name    IN (` + permissionZhengShiStr + `)`
+		}
 		if userType == 9 {
 		if userType == 9 {
 			conditionZhengshi = `  art.customer_type_ids LIKE '%9%'	   AND art.chart_permission_name  NOT  IN (` + permissionZhengShiStr + `)`
 			conditionZhengshi = `  art.customer_type_ids LIKE '%9%'	   AND art.chart_permission_name  NOT  IN (` + permissionZhengShiStr + `)`
 		}
 		}
@@ -218,39 +220,39 @@ func GetActivityLabelSpecialList(user *models.WxUserItem, conditionActivitySpeci
 	if err != nil {
 	if err != nil {
 		return
 		return
 	}
 	}
-	if len(specialList) < 80 {
-		conditionNoTrip += ` AND art.days = 0  `
-		var conditionShengjiNoTrip string
-		var conditionZhengshiNoTrip string
-		var conditionHangYeNoTrip string
-		if conditionShengji != "" {
-			conditionShengjiNoTrip = ` OR ( ` + conditionShengji + conditionNoTrip + ` )`
-		}
-		if conditionZhengshi != "" {
-			conditionZhengshiNoTrip = ` OR ( ` + conditionZhengshi + conditionNoTrip + ` )`
-		}
-		if conditionHangYe != "" {
-			conditionHangYeNoTrip = ` OR ( ` + conditionHangYe + conditionNoTrip + ` )`
-		}
-		if conditionShengji != "" {
-			conditionNoTrip += conditionShengjiNoTrip
-		}
-		if conditionZhengshi != "" {
-			conditionNoTrip += conditionZhengshiNoTrip
-		}
-		if conditionHangYe != "" {
-			conditionNoTrip += conditionHangYeNoTrip
-		}
-		conditionNoTripSql += conditionUser + conditionNoTrip + ` ORDER BY art.last_updated_time DESC`
-		specialListNotrip, e := models.GetActivityLabelSpecialListAll(conditionNoTripSql, pars, 0, 200)
-		if e != nil {
-			err = e
-			return
-		}
-		for _, v := range specialListNotrip {
-			specialList = append(specialList, v)
-		}
+	//if len(specialList) < 80 {
+	conditionNoTrip += ` AND art.days = 0  `
+	var conditionShengjiNoTrip string
+	var conditionZhengshiNoTrip string
+	var conditionHangYeNoTrip string
+	if conditionShengji != "" {
+		conditionShengjiNoTrip = ` OR ( ` + conditionShengji + conditionNoTrip + ` )`
+	}
+	if conditionZhengshi != "" {
+		conditionZhengshiNoTrip = ` OR ( ` + conditionZhengshi + conditionNoTrip + ` )`
+	}
+	if conditionHangYe != "" {
+		conditionHangYeNoTrip = ` OR ( ` + conditionHangYe + conditionNoTrip + ` )`
+	}
+	if conditionShengji != "" {
+		conditionNoTrip += conditionShengjiNoTrip
+	}
+	if conditionZhengshi != "" {
+		conditionNoTrip += conditionZhengshiNoTrip
 	}
 	}
+	if conditionHangYe != "" {
+		conditionNoTrip += conditionHangYeNoTrip
+	}
+	conditionNoTripSql += conditionUser + conditionNoTrip + ` ORDER BY art.last_updated_time DESC`
+	specialListNotrip, e := models.GetActivityLabelSpecialListAll(conditionNoTripSql, pars, 0, 200)
+	if e != nil {
+		err = e
+		return
+	}
+	for _, v := range specialListNotrip {
+		specialList = append(specialList, v)
+	}
+	//}
 	for k2, v2 := range specialList {
 	for k2, v2 := range specialList {
 		v2.Resource = 2
 		v2.Resource = 2
 		specialList[k2].KeyWord = LabelStr(v2.KeyWord, v2.IsShowSubjectName, v2.TemporaryLabel)
 		specialList[k2].KeyWord = LabelStr(v2.KeyWord, v2.IsShowSubjectName, v2.TemporaryLabel)
@@ -396,13 +398,13 @@ func GetActivitySpecialPrepareList(user *models.WxUserItem, startSize, pageSize
 	if conditionHangYe != "" {
 	if conditionHangYe != "" {
 		conditionNoTrip += conditionHangYeNoTrip
 		conditionNoTrip += conditionHangYeNoTrip
 	}
 	}
-	conditionNoTripSql := conditionUser + conditionNoTrip + ` ORDER BY art.last_updated_time DESC`
+	conditionNoTripSql := conditionUser + conditionNoTrip
 	totalPrepare, e = models.GetActivitySpecialCount(conditionNoTripSql, pars)
 	totalPrepare, e = models.GetActivitySpecialCount(conditionNoTripSql, pars)
 	if e != nil {
 	if e != nil {
 		err = errors.New("GetActivitySpecialCount, Err: " + e.Error())
 		err = errors.New("GetActivitySpecialCount, Err: " + e.Error())
 		return
 		return
 	}
 	}
-	condition += `  ORDER BY art.last_updated_time DESC `
+	conditionNoTripSql += `  ORDER BY art.last_updated_time DESC `
 	list, e = models.GetCygxActivitySpecialDetailList(conditionNoTripSql, pars, user.UserId, startSize, pageSize)
 	list, e = models.GetCygxActivitySpecialDetailList(conditionNoTripSql, pars, user.UserId, startSize, pageSize)
 	if e != nil {
 	if e != nil {
 		err = errors.New("GetCygxActivitySpecialDetailList, Err: " + e.Error())
 		err = errors.New("GetCygxActivitySpecialDetailList, Err: " + e.Error())