Ver Fonte

no message

xingzai há 10 meses atrás
pai
commit
5babca84fb
4 ficheiros alterados com 56 adições e 41 exclusões
  1. 14 12
      controllers/activity.go
  2. 3 1
      controllers/order.go
  3. 0 28
      services/micro_roadshow.go
  4. 39 0
      services/order.go

+ 14 - 12
controllers/activity.go

@@ -888,7 +888,6 @@ func (this *ActivityNoLoginController) Detail() {
 		}
 		detailResp.SignupType = mapActivitySignup[activityId]
 		resp.Detail = detailResp
-		resp.GoodsList = make([]*order.CygxGoodsResp, 0)
 	} else {
 		hasPermission, sellerName, sellerMobile, popupMsg, err := services.GetUserHasPermission(user)
 		if err != nil {
@@ -902,16 +901,6 @@ func (this *ActivityNoLoginController) Detail() {
 		resp.SellerName = sellerName
 		resp.SellerMobile = sellerMobile
 
-		if (!activityInfo.IsResearchPoints && activityInfo.IsLimitPeople == 0) || activityInfo.YidongActivityId != "" { //易董的活动 或者(不扣点且不限制人数)走月卡日卡逻辑
-			resp.GoodsList = services.GetUserGoodsCardList() //日卡月卡商品信息
-		} else {
-			resp.GoodsList = services.GetGoodsInfoByActivity(activityInfo) //单场活动信息
-			fmt.Println("activityId", activityId)
-			resp.OrderCode, resp.PayTimeCountdown = services.GetHaverEquallyOrderByUser10MinByActivty(uid, activityId) //截止支付时间倒计时
-		}
-		for _, v := range resp.GoodsList {
-			resp.PopupPriceMsg += v.PopupPriceMsg //价格弹窗信息
-		}
 		resp.IsShowWxPay = utils.IS_SHOW_WX_PAY                                                      //是否展示微信支付按钮
 		resp.IsCompanyApply = services.GetUserApplyRecordCountByCompanyIdPay(user.CompanyId)         //获取客户是否有过历史申请记录
 		resp.IsNeedBusinessCard = services.GetCygxUserBusinessCardCount(user.UserId, user.CompanyId) //是否需要上传名片
@@ -921,6 +910,20 @@ func (this *ActivityNoLoginController) Detail() {
 		resp.IsResearch = true
 	}
 
+	if (!activityInfo.IsResearchPoints && activityInfo.IsLimitPeople == 0) || activityInfo.YidongActivityId != "" { //易董的活动 或者(不扣点且不限制人数)走月卡日卡逻辑
+		resp.GoodsList = services.GetUserGoodsCardList() //日卡月卡商品信息
+	} else {
+		resp.GoodsList = services.GetGoodsInfoByActivity(activityInfo)                                             //单场活动信息
+		resp.OrderCode, resp.PayTimeCountdown = services.GetHaverEquallyOrderByUser10MinByActivty(uid, activityId) //截止支付时间倒计时
+	}
+
+	if len(resp.GoodsList) == 0 {
+		resp.GoodsList = make([]*order.CygxGoodsResp, 0)
+	} else {
+		for _, v := range resp.GoodsList {
+			resp.PopupPriceMsg += v.PopupPriceMsg //价格弹窗信息
+		}
+	}
 	if uid == 0 {
 		resp.HasPermission = 1
 	}
@@ -2518,7 +2521,6 @@ func (this *ActivityController) Check() {
 		//如果通过点数的校验,就来校验邮箱
 		resp.CheckEmail, resp.PopupMsg = services.CheckActivityUserEmail(activityInfo, user)
 	} else {
-		resp.IsShowWxPay = utils.IS_SHOW_WX_PAY
 		resp.GoodsList = services.GetGoodsInfoByActivity(activityInfo) //单场活动信息
 		for _, v := range resp.GoodsList {
 			resp.PopupPriceMsg += v.PopupPriceMsg //价格弹窗信息

+ 3 - 1
controllers/order.go

@@ -292,6 +292,8 @@ func (this *OrderController) UserOrderList() {
 		}
 	}
 
+	activityLabelKeyword := services.GetActivityOrderListLabelKeywordByActivityIds(activityIds)
+
 	for _, v := range list {
 		item := new(order.OrderListResp)
 		item.OrderCode = v.OrderCode
@@ -321,7 +323,7 @@ func (this *OrderController) UserOrderList() {
 			}
 		} else {
 			item.LabelKeywordImgLink = utils.LABEL_ICO_3
-			item.LabelKeyword = "上市公司小范围"
+			item.LabelKeyword = activityLabelKeyword[v.SourceId]
 		}
 		item.CreateTime = v.CreateTime.Format(utils.FormatDateTime)
 		resp.List = append(resp.List, item)

+ 0 - 28
services/micro_roadshow.go

@@ -850,31 +850,3 @@ func AddAllCygxVoiceAndVideoHistory(user *models.WxUserItem, sourceId, sourceTyp
 	}
 	return
 }
-
-// 获取满足路演回放的活动类型
-func GetActivityLYHFMapByActivityIds(activityIds []int) (mapResp map[int]bool) {
-	var err error
-	defer func() {
-		if err != nil {
-			go utils.SendAlarmMsg("获取满足路演回放的活动类型 GetActivityLYHFMapByActivityIds,失败,活动ID:"+fmt.Sprint(activityIds)+err.Error(), 2)
-		}
-	}()
-	var condition string
-	var pars []interface{}
-	lenArr := len(activityIds)
-	if lenArr == 0 {
-		return
-	}
-	condition = ` AND activity_id IN (` + utils.GetOrmInReplace(lenArr) + `)  `
-	pars = append(pars, activityIds)
-	list, e := models.GetActivityListByCondition(condition, pars)
-	if e != nil {
-		err = errors.New("GetIndustrialManagementNewList, Err: " + e.Error())
-		return
-	}
-	mapResp = make(map[int]bool, 0)
-	for _, v := range list {
-		mapResp[v.ActivityId] = true
-	}
-	return
-}

+ 39 - 0
services/order.go

@@ -158,3 +158,42 @@ func GetHaverEquallyOrderByUser10MinByArticle(userId, sourceId int) (orderCode s
 	}
 	return
 }
+
+// GetActivityOrderListLabelKeyword 根据活动ID获取活动自定义类型
+func GetActivityOrderListLabelKeywordByActivityIds(activityIds []int) (mapResp map[int]string) {
+	lenArr := len(activityIds)
+	if lenArr == 0 {
+		return
+	}
+	var err error
+	defer func() {
+		if err != nil {
+			fmt.Println(err)
+			go utils.SendAlarmMsg("GetActivityOrderListLabelKeywordByActivityIds,根据活动ID获取活动自定义类型 失败Err:"+err.Error(), 2)
+		}
+	}()
+	var condition string
+	var pars []interface{}
+	//获取所有研选类型的活动
+	condition += ` AND activity_id IN (` + utils.GetOrmInReplace(lenArr) + `)   `
+	pars = append(pars, activityIds)
+	listActivity, e := models.GetActivityListByCondition(condition, pars)
+	if e != nil {
+		err = errors.New("GetActivityListByCondition, Err: " + e.Error())
+		return
+	}
+	for _, v := range listActivity {
+		switch v.ActivityTypeId {
+		case 1:
+			mapResp[v.ActivityId] = "专家访谈"
+		case 5:
+			mapResp[v.ActivityId] = "专家访谈"
+		case 3:
+			mapResp[v.ActivityId] = "上市公司小范围"
+		case 8:
+			mapResp[v.ActivityId] = "买方交流"
+		}
+	}
+
+	return
+}