|
@@ -134,7 +134,8 @@ func GetActivityLabelSpecialList(user *models.WxUserItem, isPower int, chartPerm
|
|
|
item = itemList
|
|
|
return
|
|
|
}
|
|
|
- userType, e := GetSpecialUserType(user)
|
|
|
+ //userType, e := GetSpecialUserType(user)
|
|
|
+ userType, _, e := GetUserType(user.CompanyId)
|
|
|
if e != nil {
|
|
|
err = errors.New("GetSpecialUserType, Err: " + e.Error())
|
|
|
return
|
|
@@ -167,7 +168,6 @@ func GetActivityLabelSpecialList(user *models.WxUserItem, isPower int, chartPerm
|
|
|
}
|
|
|
var pars []interface{}
|
|
|
condition += ` AND art.publish_status = 1 AND art.label != '' AND art.is_offline = 0 `
|
|
|
-
|
|
|
//行业名称
|
|
|
if isPower == 1 {
|
|
|
condition += ` AND art.chart_permission_name IN (` + permissionNameStr + `) `
|
|
@@ -175,16 +175,18 @@ func GetActivityLabelSpecialList(user *models.WxUserItem, isPower int, chartPerm
|
|
|
if chartPermissionIds != "" {
|
|
|
condition += ` AND art.chart_permission_id IN (` + chartPermissionIds + `) `
|
|
|
}
|
|
|
- conditionTrip := condition
|
|
|
- conditionTripSql := condition
|
|
|
- conditionNoTrip := condition
|
|
|
- conditionNoTripSql := condition
|
|
|
+
|
|
|
//condition += conditionUser
|
|
|
conditionShengji, conditionZhengshi, conditionHangYe, e := ActivityLabelSpecialUserSql(user)
|
|
|
if e != nil {
|
|
|
err = errors.New("ActivityLabelSpecialUserSql, Err: " + e.Error())
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+ conditionTrip := condition
|
|
|
+ conditionNoTrip := condition
|
|
|
+ conditionTripSql := condition
|
|
|
+ conditionNoTripSql := condition
|
|
|
conditionTrip += ` AND art.days > 0 AND art.activity_time_end > '` + time.Now().Format(utils.FormatDateTime) + ` '`
|
|
|
|
|
|
var conditionZhengshiTrip string
|
|
@@ -213,6 +215,11 @@ func GetActivityLabelSpecialList(user *models.WxUserItem, isPower int, chartPerm
|
|
|
conditionTrip += conditionHangYeTrip
|
|
|
}
|
|
|
|
|
|
+ //行业套餐客户勾选项单独处理
|
|
|
+ if userType == 3 {
|
|
|
+ conditionTripSql += ` AND art.chart_permission_name IN (` + permissionNameStr + `) `
|
|
|
+ }
|
|
|
+
|
|
|
conditionTripSql += conditionUser + conditionTrip + ` ORDER BY art.activity_time ASC `
|
|
|
specialList, err := models.GetActivityLabelSpecialListAll(conditionTripSql, pars, 0, 80)
|
|
|
if err != nil {
|
|
@@ -240,6 +247,10 @@ func GetActivityLabelSpecialList(user *models.WxUserItem, isPower int, chartPerm
|
|
|
if conditionHangYe != "" {
|
|
|
conditionNoTrip += conditionHangYeNoTrip
|
|
|
}
|
|
|
+ //行业套餐客户勾选项单独处理
|
|
|
+ if userType == 3 {
|
|
|
+ conditionNoTripSql += ` AND art.chart_permission_name IN (` + permissionNameStr + `) `
|
|
|
+ }
|
|
|
conditionNoTripSql += conditionUser + conditionNoTrip + ` ORDER BY art.last_updated_time DESC`
|
|
|
specialListNotrip, e := models.GetActivityLabelSpecialListAll(conditionNoTripSql, pars, 0, 200)
|
|
|
if e != nil {
|
|
@@ -315,6 +326,13 @@ func HandleActivityLabelSpecialTripPermission(user *models.WxUserItem) (conditio
|
|
|
err = errors.New("GetSpecialUserType, Err: " + e.Error())
|
|
|
return
|
|
|
}
|
|
|
+ mapUserType, e := GetActivityCcustomerTypeList()
|
|
|
+ if e != nil {
|
|
|
+ err = e
|
|
|
+ return
|
|
|
+ }
|
|
|
+ var userTypeStr string
|
|
|
+ userTypeStr = mapUserType[userType]
|
|
|
//fmt.Println(userType)
|
|
|
slicePer := strings.Split(permissionStr, ",")
|
|
|
var permissionSqlStr string
|
|
@@ -332,7 +350,7 @@ func HandleActivityLabelSpecialTripPermission(user *models.WxUserItem) (conditio
|
|
|
//if permissionSqlStr != "" {
|
|
|
// condition += ` AND art.chart_permission_name IN (` + permissionSqlStr + `) `
|
|
|
//}
|
|
|
- condition += ` AND art.customer_type_ids LIKE '%` + strconv.Itoa(userType) + `%' `
|
|
|
+ condition += ` AND art.customer_type_ids LIKE '%` + userTypeStr + `%' `
|
|
|
|
|
|
//if userType != 2 {
|
|
|
|