|
@@ -73,6 +73,7 @@ func (this *ArticleController) Detail() {
|
|
|
}
|
|
|
|
|
|
hasPermission := 2
|
|
|
+ hasFree := 2
|
|
|
articlePermission, err := models.GetArticlePermission(detail.SubCategoryName)
|
|
|
if err != nil {
|
|
|
br.Msg = "获取信息失败"
|
|
@@ -91,6 +92,9 @@ func (this *ArticleController) Detail() {
|
|
|
br.ErrMsg = "判断是否已申请访谈失败,Err:" + strconv.Itoa(uid) + ";articleId" + strconv.Itoa(articleId)
|
|
|
return
|
|
|
}
|
|
|
+ if companyPermission != "" {
|
|
|
+ hasFree = 1
|
|
|
+ }
|
|
|
if strings.Contains(companyPermission, articlePermission.PermissionName) {
|
|
|
hasPermission = 1
|
|
|
}
|
|
@@ -120,6 +124,7 @@ func (this *ArticleController) Detail() {
|
|
|
}
|
|
|
resp := new(models.ArticleDetailResp)
|
|
|
resp.HasPermission = hasPermission
|
|
|
+ resp.HasFree = hasFree
|
|
|
resp.Detail = detail
|
|
|
br.Ret = 200
|
|
|
br.Success = true
|
|
@@ -281,22 +286,22 @@ func (this *ArticleCommonController) Detail() {
|
|
|
this.ServeJSON()
|
|
|
}()
|
|
|
|
|
|
- articleIdMd5:= this.GetString("ArticleIdMd5")
|
|
|
- if articleIdMd5 =="" {
|
|
|
+ articleIdMd5 := this.GetString("ArticleIdMd5")
|
|
|
+ if articleIdMd5 == "" {
|
|
|
br.Msg = "参数错误"
|
|
|
br.ErrMsg = "参数错误"
|
|
|
return
|
|
|
}
|
|
|
resp := new(models.ArticleDetailResp)
|
|
|
detail, err := models.GetArticleDetailByIdMd5(articleIdMd5)
|
|
|
- if err != nil && err.Error()!=utils.ErrNoRow() {
|
|
|
+ if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
br.Msg = "获取信息失败"
|
|
|
- br.ErrMsg = "获取信息失败,Err:"+err.Error()
|
|
|
+ br.ErrMsg = "获取信息失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
- if detail==nil {
|
|
|
+ if detail == nil {
|
|
|
resp.HasPermission = 2
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
resp.HasPermission = 1
|
|
|
}
|
|
|
resp.Detail = detail
|