Browse Source

no message

xingzai 11 tháng trước cách đây
mục cha
commit
8ae69bbd34
3 tập tin đã thay đổi với 38 bổ sung6 xóa
  1. 4 0
      controllers/order.go
  2. 8 6
      models/order/order.go
  3. 26 0
      services/order.go

+ 4 - 0
controllers/order.go

@@ -479,6 +479,10 @@ func (this *OrderController) OrderDetail() {
 	resp.OrderStatus = orderDetail.OrderStatus
 	resp.Source = orderDetail.Source
 	resp.SourceId = orderDetail.SourceId
+	if orderDetail.Source == utils.CYGX_OBJ_ACTIVITY {
+		resp.IsPublicActivitie, resp.IsSignUp = services.GetActivityWechatPayMsg(orderDetail.SourceId) //如果是活动就要判断是否是公开活动,是否需要自动报名
+	}
+
 	br.Data = resp
 	br.Ret = 200
 	br.Success = true

+ 8 - 6
models/order/order.go

@@ -146,12 +146,14 @@ type UserOrderListResp struct {
 }
 
 type PayEdOrderDetailResp struct {
-	OrderCode   string `comment:"订单编号"`
-	OrderType   int    `comment:"订单类型,1:畅读卡订单,2:单场付费订单"`
-	EndDate     string `comment:"结束日期"`
-	OrderStatus int    `comment:"订单状态,0:已取消、1:待支付、2:已支付、3:已退款"`
-	SourceId    int    `comment:"来源ID"`
-	Source      string `comment:"来源\n报告 :article\n活动 :activity"`
+	OrderCode         string `comment:"订单编号"`
+	OrderType         int    `comment:"订单类型,1:畅读卡订单,2:单场付费订单"`
+	EndDate           string `comment:"结束日期"`
+	OrderStatus       int    `comment:"订单状态,0:已取消、1:待支付、2:已支付、3:已退款"`
+	SourceId          int    `comment:"来源ID"`
+	Source            string `comment:"来源\n报告 :article\n活动 :activity"`
+	IsPublicActivitie bool   `comment:"是否是公开活动"`
+	IsSignUp          bool   `comment:"是否自动报名"`
 }
 
 // 添加

+ 26 - 0
services/order.go

@@ -463,3 +463,29 @@ func CancelActivitySignupByWechatPay(activityId, userId int) {
 
 	return
 }
+
+// 获取支付之后活动相关的弹窗信息
+func GetActivityWechatPayMsg(activityId int) (isPublicActivitie, isSignUp bool) {
+	var err error
+	defer func() {
+		if err != nil {
+			fmt.Println(err)
+			go utils.SendAlarmMsg(fmt.Sprint("获取支付之后活动相关的弹窗信息失败 GetActivityWechatPayMsg, err:", err.Error(), "activityId:", activityId), 2)
+		}
+	}()
+	activityInfo, e := models.GetAddActivityInfoById(activityId)
+	if e != nil {
+		err = errors.New("GetAddActivityInfoById, Err: " + e.Error())
+		return
+	}
+
+	if (!activityInfo.IsResearchPoints && activityInfo.IsLimitPeople == 0) || activityInfo.YidongActivityId != "" { //易董的活动 或者(不扣点且不限制人数)是公开活动
+		isPublicActivitie = true //日卡月卡商品信息
+	}
+
+	//专家线下沙龙与买方线下交流自动报名
+	if activityInfo.ActivityTypeId == 5 || activityInfo.ActivityTypeId == 8 {
+		isSignUp = true
+	}
+	return
+}