xingzai 11 сар өмнө
parent
commit
708c1da84f

+ 6 - 2
controllers/yanxuan_special.go

@@ -146,6 +146,7 @@ func (this *BaseAuthMobileController) List() {
 // @Title 专栏详情
 // @Description 专栏详情
 // @Param   IsSendWx   query   int  false       "是否是通过微信模版进来的 1是,其它否"
+// @Param   InviteShareCode   query   string  false       "销售账号邀请码"
 // @Param   Id   query   int  true       "详情ID"
 // @Success 200 {object} models.AddEnglishReportResp
 // @router /detail [get]
@@ -165,7 +166,7 @@ func (this *BaseAuthMobileController) Detail() {
 
 	specialId, _ := this.GetInt("Id", 0)
 	isSendWx, _ := this.GetInt("IsSendWx", 0)
-
+	inviteShareCode := this.GetString("InviteShareCode")
 	if specialId <= 0 {
 		br.Msg = "参数错误"
 		br.ErrMsg = "参数错误"
@@ -181,7 +182,10 @@ func (this *BaseAuthMobileController) Detail() {
 	if item.MyCollectNum > 0 {
 		item.IsCollect = 1
 	}
-
+	//记录分享来源
+	if inviteShareCode != "" {
+		go services.AddCygxUserAdminShareHistory(user, utils.CYGX_OBJ_YANXUANSPECIAL, item.Title, inviteShareCode, specialId)
+	}
 	var resp models.CygxYanxuanSpecialResp
 	resp.HasPermission = 1
 	resp.CygxYanxuanSpecialItem = *item

+ 2 - 0
services/user_admin_share.go

@@ -86,6 +86,8 @@ func AddCygxUserAdminShareHistory(user *models.WxUserItem, source, sourceTitle,
 		item.Action = "查看活动"
 	case utils.CYGX_OBJ_ARTICLE:
 		item.Action = "查看报告"
+	case utils.CYGX_OBJ_YANXUANSPECIAL:
+		item.Action = "查看专栏"
 	case "login":
 		item.Action = "注册"
 	}