Browse Source

no message

xingzai 9 months ago
parent
commit
09d42cd212
2 changed files with 22 additions and 6 deletions
  1. 2 1
      controllers/activity.go
  2. 20 5
      services/activity.go

+ 2 - 1
controllers/activity.go

@@ -2449,8 +2449,9 @@ func (this *ActivityController) ScheduleList() {
 		}
 		v.SignupType = mapActivitySignup[v.ActivityId]
 		//处理列表的标签是否展示逻辑
-		resp.List = append(resp.List, services.ActivityButtonShow(v, user, make([]string, 0)))
 	}
+
+	resp.List = services.ActivityArrButtonShow(list, user, make([]string, 0))
 	resp.Paging = page
 	br.Ret = 200
 	br.Success = true

+ 20 - 5
services/activity.go

@@ -4,6 +4,7 @@ import (
 	"errors"
 	"fmt"
 	"hongze/hongze_web_mfyx/models"
+	"hongze/hongze_web_mfyx/models/order"
 	"hongze/hongze_web_mfyx/utils"
 	"strconv"
 	"strings"
@@ -899,11 +900,17 @@ func ActivityArrButtonShow(items []*models.ActivityDetail, user *models.WxUserIt
 	}
 	activityPointsByUserAllMap := GetActivityPointsByUserAllMap() // 获取对用户进行研选扣点的活动
 
-	//virtualAssetActivityList ,e := order.GetCygxOrderVirtualAssetActivityList(activityIds, user.Mobile)
-	//if e != nil {
-	//	e = errors.New("GetCygxOrderVirtualAssetActivityList, Err: " + e.Error())
-	//	return
-	//}
+	virtualAssetActivityList, e := order.GetCygxOrderVirtualAssetActivityList(activityIds, user.Mobile) // 获取用户购买的单场活动信息
+	if e != nil {
+		e = errors.New("GetCygxOrderVirtualAssetActivityList, Err: " + e.Error())
+		return
+	}
+	virtualAssetActivityIds := make(map[int]bool)
+	for _, v := range virtualAssetActivityList {
+		virtualAssetActivityIds[v.SourceId] = true
+	}
+	userCardTotal := GetCygxOrderUserCardTotal(user.Mobile) //用户是否持有有效卡片
+
 	for _, activityDetail := range items {
 
 		//IsShowAppointment       bool                       `description:"是否展示预约纪要"`
@@ -1130,6 +1137,14 @@ func ActivityArrButtonShow(items []*models.ActivityDetail, user *models.WxUserIt
 					au.HasPermission = 1
 				}
 			}
+			if (!v.IsResearchPoints && v.IsLimitPeople == 0) || v.YidongActivityId != "" { //易董的活动 或者(不扣点且不限制人数)走月卡日卡逻辑
+				if userCardTotal > 0 {
+					au.HasPermission = 1
+				}
+			}
+			if virtualAssetActivityIds[v.ActivityId] {
+				au.HasPermission = 1
+			}
 		}
 
 		// 无权限的弹框提示