|
@@ -146,13 +146,13 @@ func (this *ActivitySpecialCoAntroller) SpecialDetail() {
|
|
|
resp.Detail = activityInfo
|
|
|
resp.Detail = activityInfo
|
|
|
} else {
|
|
|
- hasPermission, sellerName, sellerMobile, err := services.GetUserHasPermission(user)
|
|
|
+ hasPermission, sellerName, sellerMobile, popupMsg, err := services.GetUserHasPermission(user)
|
|
|
if err != nil {
|
|
|
br.Msg = "获取信息失败"
|
|
|
br.ErrMsg = "判断是否已申请过试用失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
- resp.PopupMsg = "您暂无权限参加此活动,若想参加可以申请开通对应的试用权限"
|
|
|
+ resp.PopupMsg = popupMsg
|
|
|
resp.HasPermission = hasPermission
|
|
|
resp.SellerName = sellerName
|
|
|
resp.SellerMobile = sellerMobile
|
|
@@ -257,44 +257,28 @@ func (this *ActivitySpecialCoAntroller) SpecialTripAdd() {
|
|
|
return
|
|
|
}
|
|
|
//SignupStatus int `description:"返回状态:1:成功 、2 :人数已满 、3:调研次数已用完、 4:超时"`
|
|
|
-
|
|
|
- ////给所属销售发送消息
|
|
|
- //if sellerItem.Mobile != "" {
|
|
|
- // openIpItem, _ := models.GetUserRecordByMobile(4, sellerItem.Mobile)
|
|
|
- // if openIpItem != nil && openIpItem.OpenId != "" {
|
|
|
- // if sellerItem != nil {
|
|
|
- // go services.SendSpecialTemplateMsg(user.RealName+"【"+user.CompanyName+"】", time.Now().Format(utils.FormatDateTime), user.Mobile, activityInfo.ResearchTheme, "sale", openIpItem)
|
|
|
- // }
|
|
|
- // }
|
|
|
- //}
|
|
|
-
|
|
|
- // 给芳姐发消息
|
|
|
- //cnf, _ := models.GetConfigByCode("tpl_msg")
|
|
|
- //if cnf != nil {
|
|
|
- // openIpItem, _ := models.GetUserRecordByMobile(4, cnf.ConfigValue)
|
|
|
- // if openIpItem != nil && openIpItem.OpenId != "" {
|
|
|
- // actList, _ := models.GetActivityListSpecialAll(activityId)
|
|
|
- // if len(actList) == 5 {
|
|
|
- // var companyName string
|
|
|
- // for _, v := range actList {
|
|
|
- // companyName += "【" + v.CompanyName + "】"
|
|
|
- // }
|
|
|
- // go services.SendSpecialTemplateMsg(companyName, "", "", activityInfo.ResearchTheme, "", openIpItem)
|
|
|
- // }
|
|
|
- // }
|
|
|
- //}
|
|
|
- ////用户专项调研操作行为,模板消息推送
|
|
|
- //go services.SpecialActivityUserRemind(user, activityInfo, 1)
|
|
|
+ } else {
|
|
|
+ updateParams := make(map[string]interface{})
|
|
|
+ updateParams["IsValid"] = 1
|
|
|
+ updateParams["CreateTime"] = time.Now()
|
|
|
+ updateParams["IsCancel"] = 0
|
|
|
+ whereParam := map[string]interface{}{"user_id": user.UserId, "activity_id": activityId}
|
|
|
+ err = models.UpdateByExpr(models.CygxActivitySpecialTrip{}, whereParam, updateParams)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "报名失败,"
|
|
|
+ br.ErrMsg = "二次报名,更改报名是否有效状态失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
- hasPermission, sellerName, sellerMobile, err := services.GetUserHasPermission(user)
|
|
|
+ hasPermission, sellerName, sellerMobile, popupMsg, err := services.GetUserHasPermission(user)
|
|
|
if err != nil {
|
|
|
br.Msg = "获取信息失败"
|
|
|
br.ErrMsg = "判断是否已申请过试用失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
- resp.PopupMsg = "您暂无权限参加此活动,若想参加可以申请开通对应的试用权限"
|
|
|
+ resp.PopupMsg = popupMsg
|
|
|
resp.HasPermission = hasPermission
|
|
|
resp.SellerName = sellerName
|
|
|
resp.SellerMobile = sellerMobile
|
|
@@ -344,13 +328,21 @@ func (this *ActivitySpecialCoAntroller) Tripcancel() {
|
|
|
br.ErrMsg = "操作失败,Err:" + errInfo.Error()
|
|
|
return
|
|
|
}
|
|
|
- err = models.CancelActivitySpecialTrip(uid, activityInfo)
|
|
|
- if err != nil {
|
|
|
- br.Msg = "操作失败"
|
|
|
- br.ErrMsg = "CancelActivitySpecialTrip,Err:" + err.Error()
|
|
|
- return
|
|
|
+ resultTime := utils.StrTimeToTime(activityInfo.ActivityTime)
|
|
|
+ //48小时之内的取消也扣除一次参会记录
|
|
|
+ var isValid int
|
|
|
+ if time.Now().Add(+time.Hour * 48).After(resultTime) {
|
|
|
+ isValid = 1
|
|
|
+ }
|
|
|
+ if isValid == 0 {
|
|
|
+ err = models.CancelActivitySpecialTripIsValid(isValid, activityInfo.ActivityId, uid)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "操作失败"
|
|
|
+ br.ErrMsg = "CancelActivitySpecialTrip,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
}
|
|
|
br.Ret = 200
|
|
|
br.Success = true
|
|
|
- br.Msg = "会议提醒已取消"
|
|
|
+ br.Msg = "已取消"
|
|
|
}
|