|
@@ -268,7 +268,7 @@ func (this *YanxuanSpecialNoLoginController) Detail() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- fllowNum, err := models.GetCygxYanxuanSpecialFollowCountByUserId(sysUser.UserId, item.UserId)
|
|
|
+ fllowNum, err := models.GetCygxYanxuanSpecialFollowCountByUser(sysUser.UserId, item.UserId)
|
|
|
if err != nil {
|
|
|
br.Msg = "获取失败"
|
|
|
br.ErrMsg = "获取是否关注作者失败, Err:" + err.Error()
|
|
@@ -498,7 +498,7 @@ func (this *YanxuanSpecialController) Save() {
|
|
|
go services.UpdateYanxuanSpecialResourceData(specialId) // 写入首页最新 cygx_resource_data 表
|
|
|
go services.EsAddYanxuanSpecial(specialId) // 写入es 综合搜索
|
|
|
go services.SendWxMsgSpecialFollow(req.Id) //研选专栏有新内容审核通过时,给关注此专栏的客户发送模板消息
|
|
|
- go services.SendWxMsgSpecialAuthor(req.Id, 2) //研选专栏审核完成时,给提交人发送模板消息
|
|
|
+ go services.SendWxMsgSpecialAuthor(req.Id, 1) //研选专栏审核完成时,给提交人发送模板消息
|
|
|
go services.UdpateYanxuanSpecialauthorArticleNum(authorUserId) // 更新作者发布文章的数量
|
|
|
go services.SendWxCategoryMsgSpecialAuthor(req.Id, 1) //研选专栏审核完成时,给提交人发送类目模板消息
|
|
|
go services.SendWxCategoryMsgSpecialFollow(req.Id) // 研选专栏有新内容审核通过时,给关注此专栏的客户发送模板消息
|
|
@@ -542,6 +542,9 @@ func (this *YanxuanSpecialNoLoginController) AuthorDetail() {
|
|
|
br.ErrMsg = "获取失败, Err:" + tmpErr.Error()
|
|
|
return
|
|
|
}
|
|
|
+ if item.IsFollow > 0 {
|
|
|
+ item.IsFollow = 1
|
|
|
+ }
|
|
|
|
|
|
br.Data = item
|
|
|
br.Ret = 200
|
|
@@ -847,26 +850,34 @@ func (this *YanxuanSpecialController) Follow() {
|
|
|
}
|
|
|
|
|
|
if req.Status == 1 {
|
|
|
- item := models.CygxYanxuanSpecialFollow{
|
|
|
- UserId: user.UserId,
|
|
|
- FollowUserId: authorItem.UserId,
|
|
|
- Mobile: user.Mobile,
|
|
|
- Email: user.Email,
|
|
|
- CompanyId: user.CompanyId,
|
|
|
- CompanyName: user.CompanyName,
|
|
|
- RealName: user.RealName,
|
|
|
- SellerName: sellerName,
|
|
|
- CreateTime: time.Now(),
|
|
|
- ModifyTime: time.Now(),
|
|
|
- RegisterPlatform: utils.REGISTER_PLATFORM,
|
|
|
- YanxuanSpecialId: req.SpecialId,
|
|
|
- }
|
|
|
- err = models.AddCygxYanxuanSpecialFollow(&item)
|
|
|
+ followCount, err := models.GetCygxYanxuanSpecialFollowCountByUser(user.UserId, authorItem.UserId)
|
|
|
if err != nil {
|
|
|
- br.Msg = "新增失败"
|
|
|
- br.ErrMsg = "新增失败,Err:" + err.Error()
|
|
|
+ br.Msg = "获取失败"
|
|
|
+ br.ErrMsg = "获取失败, Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
+ if followCount == 0 {
|
|
|
+ item := models.CygxYanxuanSpecialFollow{
|
|
|
+ UserId: user.UserId,
|
|
|
+ FollowUserId: authorItem.UserId,
|
|
|
+ Mobile: user.Mobile,
|
|
|
+ Email: user.Email,
|
|
|
+ CompanyId: user.CompanyId,
|
|
|
+ CompanyName: user.CompanyName,
|
|
|
+ RealName: user.RealName,
|
|
|
+ SellerName: sellerName,
|
|
|
+ CreateTime: time.Now(),
|
|
|
+ ModifyTime: time.Now(),
|
|
|
+ RegisterPlatform: utils.REGISTER_PLATFORM,
|
|
|
+ YanxuanSpecialId: req.SpecialId,
|
|
|
+ }
|
|
|
+ err = models.AddCygxYanxuanSpecialFollow(&item)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "新增失败"
|
|
|
+ br.ErrMsg = "新增失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
br.Msg = "关注成功"
|
|
|
} else {
|
|
|
err = models.DelCygxYanxuanSpecialFollow(user.UserId, authorItem.UserId)
|