|
@@ -244,32 +244,33 @@ func (this *BaseAuthMobileController) Detail() {
|
|
|
resp.ContentHasStyle = true
|
|
|
}
|
|
|
|
|
|
- //var hasPermission int
|
|
|
- //if userId > 0 {
|
|
|
- // hasPermission, err = services.GetUserYxHasPermissionCode(user)
|
|
|
- // if err != nil {
|
|
|
- // br.Msg = "获取失败"
|
|
|
- // br.ErrMsg = "获取失败, Err:" + err.Error()
|
|
|
- // }
|
|
|
- //}
|
|
|
-
|
|
|
- //resp.HasPermission = hasPermission
|
|
|
- if user.UserId == 0 {
|
|
|
- resp.HasPermission = 1
|
|
|
+ //校验研选专栏权限,以及无权限的时候的对应状态码
|
|
|
+ havePower, err := services.GetYanxuanSpecialDetailUserPower(user)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取信息失败"
|
|
|
+ br.ErrMsg = "校验用户权限失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ var hasPermission int
|
|
|
+ if havePower {
|
|
|
+ hasPermission = 1
|
|
|
+ } else {
|
|
|
+ hasPermission, err = services.GetUserDetailPermissionCode(user.UserId, user.CompanyId)
|
|
|
+ if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ br.Msg = "获取信息失败"
|
|
|
+ br.ErrMsg = "获取信息失败,GetUserDetailPermissionCode Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ resp.HasPermission = hasPermission
|
|
|
+ //支付信息
|
|
|
+ resp.IsShowWxPay = utils.IS_SHOW_WX_PAY //是否展示微信支付按钮
|
|
|
+ resp.IsCompanyApply = services.GetUserApplyRecordCountByCompanyIdPay(user.CompanyId) //获取客户是否有过历史申请记录
|
|
|
+ resp.IsNeedBusinessCard = services.GetCygxUserBusinessCardCount(user.UserId, user.CompanyId) //是否需要上传名片
|
|
|
+ resp.GoodsList = services.GetUserGoodsCardList() //日卡月卡商品信息
|
|
|
+ for _, v := range resp.GoodsList {
|
|
|
+ resp.PopupPriceMsg += v.PopupPriceMsg //价格弹窗信息
|
|
|
}
|
|
|
-
|
|
|
- //如果是用户本人写的专栏,那么就不做校验
|
|
|
- //if item.UserId == user.UserId || user.UserId == 0 {
|
|
|
- // resp.HasPermission = 1
|
|
|
- //} else {
|
|
|
- // hasPermission, err = services.GetUserRaiPermissionYanXuanInfo(user)
|
|
|
- // if err != nil {
|
|
|
- // br.Msg = "获取失败"
|
|
|
- // br.ErrMsg = "获取失败, Err:" + err.Error()
|
|
|
- // return
|
|
|
- // }
|
|
|
- // resp.HasPermission = hasPermission
|
|
|
- //}
|
|
|
|
|
|
br.Data = resp
|
|
|
br.Ret = 200
|
|
@@ -457,7 +458,7 @@ func (this *YanxuanSpecialController) Save() {
|
|
|
go services.UpdateYanxuanSpecialResourceData(specialId) // 写入首页最新 cygx_resource_data 表
|
|
|
go services.EsAddYanxuanSpecial(specialId) // 写入es 综合搜索
|
|
|
go services.SendWxMsgSpecialFollow(req.Id) //研选专栏有新内容审核通过时,给关注此专栏的客户发送模板消息
|
|
|
- go services.SendWxCategoryMsgSpecialFollow(req.Id) //研选专栏有新内容审核通过时,给关注此专栏的客户发送模板消息
|
|
|
+ go services.SendWxCategoryMsgSpecialFollow(req.Id) //研选专栏有新内容审核通过时,给关注此专栏的客户发送模板消息
|
|
|
go services.SendWxMsgSpecialAuthor(req.Id, 1) //研选专栏审核完成时,给提交人发送模板消息
|
|
|
go services.SendWxCategoryMsgSpecialAuthor(req.Id, 1) //研选专栏审核完成时,给提交人发送类目模板消息
|
|
|
go services.UdpateYanxuanSpecialauthorArticleNum(authorUserId) // 更新作者发布文章的数量
|