|
@@ -1,11 +1,13 @@
|
|
|
package services
|
|
|
|
|
|
import (
|
|
|
+ "errors"
|
|
|
"fmt"
|
|
|
"hongze/hongze_cygx/models"
|
|
|
+ "strconv"
|
|
|
)
|
|
|
|
|
|
-//是否展示限免标签
|
|
|
+// 是否展示限免标签
|
|
|
func GetShowSustainable() (isShowSustainable bool) {
|
|
|
total, err := models.GetShowSustainable()
|
|
|
if err != nil {
|
|
@@ -29,3 +31,19 @@ func GetShowSustainableNew() (isShowSustainable bool, err error) {
|
|
|
}
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+// GetIndustryUserFollowMap 获取用户关注的产业
|
|
|
+func GetIndustryUserFollowMap(user *models.WxUserItem) (itemMap map[int]bool, err error) {
|
|
|
+ condition := ` AND user_id = ` + strconv.Itoa(user.UserId)
|
|
|
+ listIndustryFllow, e := models.GetCygxIndustryFllowList(condition)
|
|
|
+ if e != nil {
|
|
|
+ err = errors.New("GetCygxIndustryFllowList " + e.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
+ follwMap := make(map[int]bool)
|
|
|
+ for _, v := range listIndustryFllow {
|
|
|
+ follwMap[v.IndustrialManagementId] = true
|
|
|
+ }
|
|
|
+ itemMap = follwMap
|
|
|
+ return
|
|
|
+}
|