12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- package services
- import (
- "errors"
- "fmt"
- "hongze/hongze_cygx/models"
- "strconv"
- )
- // 是否展示限免标签
- func GetShowSustainable() (isShowSustainable bool) {
- total, err := models.GetShowSustainable()
- if err != nil {
- fmt.Println("GetShowSustainable Err:", err.Error())
- return
- }
- if total > 0 {
- isShowSustainable = true
- }
- return
- }
- func GetShowSustainableNew() (isShowSustainable bool, err error) {
- total, err := models.GetShowSustainable()
- if err != nil {
- fmt.Println("GetShowSustainable Err:", err.Error())
- return
- }
- if total > 0 {
- isShowSustainable = true
- }
- return
- }
- // GetIndustryUserFollowMap 获取用户关注的产业
- func GetIndustryUserFollowMap(user *models.WxUserItem) (itemMap map[int]bool, err error) {
- condition := ` AND user_id = ` + strconv.Itoa(user.UserId)
- listIndustryFllow, e := models.GetCygxIndustryFllowListByUserId(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
- }
|