Browse Source

no message

xingzai 10 months ago
parent
commit
37d9ae362e
2 changed files with 16 additions and 1 deletions
  1. 15 1
      controllers/activity.go
  2. 1 0
      models/activity.go

+ 15 - 1
controllers/activity.go

@@ -346,6 +346,20 @@ func (this *ActivityCoAntroller) Detail() {
 		br.ErrMsg = "活动ID错误,Err:" + "activityId:" + strconv.Itoa(activityId)
 		return
 	}
+
+	if activityInfo.IsResearchPoints {
+		//获取活动对用户要扣的点
+		userPointsNum, err := models.GetCygxActivityPointsSetUserNum(activityInfo.ActivityId)
+		if err != nil {
+			br.Msg = "获取信息失败"
+			br.ErrMsg = "获取活动详情获取活动对用户要扣的点信息失败,Err:" + err.Error()
+			return
+		}
+		if userPointsNum > 0 {
+			activityInfo.IsResearchPointsByUser = true
+		}
+	}
+
 	//记录分享来源
 	if inviteShareCode != "" {
 		go services.AddCygxUserAdminShareHistory(user, utils.CYGX_OBJ_ACTIVITY, activityInfo.ActivityName, inviteShareCode, activityId)
@@ -1481,7 +1495,7 @@ func (this *ActivityCoAntroller) AskAdd() {
 
 			//openIpItem, _ := models.GetUserRecordByMobile(4, sellerItem.Mobile)
 			//if openIpItem != nil && openIpItem.OpenId != "" {
-				//services.SendActivityAskApplyTemplateMsgV2(user.RealName+"——"+user.CompanyName+"("+sellerItem.RealName+")", "提问:"+activityInfo.ActivityName, time.Now().Format(utils.FormatDateTime), req.Content, activityInfo.ActivityName, openIpItem, activityInfo, int(msgId))
+			//services.SendActivityAskApplyTemplateMsgV2(user.RealName+"——"+user.CompanyName+"("+sellerItem.RealName+")", "提问:"+activityInfo.ActivityName, time.Now().Format(utils.FormatDateTime), req.Content, activityInfo.ActivityName, openIpItem, activityInfo, int(msgId))
 			//}
 		}
 	}

+ 1 - 0
models/activity.go

@@ -233,6 +233,7 @@ type ActivityDetail struct {
 	SiginupDeadline           string                     `description:"报名截止时间"`
 	IsExternalLabel           bool                       `description:"是否为外部资源"`
 	IsResearchPoints          bool                       `description:"是否为研选扣点"`
+	IsResearchPointsByUser    bool                       `description:"是否为扣用户点数的研选扣点"`
 	CancelDeadline            string                     `description:"取消报名截止时间"`
 	ImgUrlBgYx                string                     `description:"研选背景图片"`
 	ChartPermissionNameDeputy string                     `description:"副行业名称"`