|
@@ -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())
|