xingzai hace 1 año
padre
commit
f30b2c00ff

+ 17 - 0
controllers/yanxuan_special.go

@@ -6,6 +6,7 @@ import (
 	"hongze/hongze_cygx/models"
 	"hongze/hongze_cygx/services"
 	"hongze/hongze_cygx/utils"
+	"strings"
 	"time"
 )
 
@@ -160,6 +161,8 @@ func (this *YanxuanSpecialController) Detail() {
 	}
 
 	var resp models.CygxYanxuanSpecialResp
+
+	resp.HasPermission = 1
 	resp.CygxYanxuanSpecialItem = *item
 	if item.DocUrl != "" {
 		var docs []models.Doc
@@ -189,6 +192,20 @@ func (this *YanxuanSpecialController) Detail() {
 		}
 		resp.ExamineStatus = item.Status
 	}
+	resp.ExamineStatus = item.Status
+
+	var configCode string
+	//如果是研选的就推送给汪洋跟王芳,否则就推送给王芳
+	configCode = utils.TPL_MSG_WANG_FANG_WANG_YANG
+	cnf, err := models.GetConfigByCode(configCode)
+	if err != nil {
+		br.Msg = "获取失败"
+		br.ErrMsg = "获取失败, Err:" + err.Error()
+		return
+	}
+	if item.UserId != sysUser.UserId && item.Status != 3 && !strings.Contains(cnf.ConfigValue, sysUser.Mobile) {
+		resp.HasPermission = 2
+	}
 
 	go services.AddSpecialRecord(this.User, specialId)
 

+ 1 - 1
models/cygx_yanxuan_special.go

@@ -61,7 +61,7 @@ type CygxYanxuanSpecialResp struct {
 	CompanyTags   []string
 	IndustryTags  []string
 	HasPermission int  `description:"1:正常展示,2:不展示"`
-	ExamineStatus int  `description:"1:审核通过,2:审核未通过"`
+	ExamineStatus int  `description:"1:未发布,2:审核中 3:已发布 4:驳回"`
 	IsShowExamine bool `description:"是否展示审核状态按钮"`
 }
 

+ 25 - 0
services/cygx_yanxuan_special.go

@@ -302,3 +302,28 @@ func UpdateYanxuanSpecialResourceData(sourceId int) {
 	}
 	return
 }
+
+// 获取研选专栏用户信息
+func GetYanxuanSpecialAuthorInfo(user *models.WxUserItem) (isAuthor, isImproveInformation bool) {
+	var err error
+	defer func() {
+		if err != nil {
+			go utils.SendAlarmMsg(fmt.Sprint("获取研选专栏用户信息失败,GetYanxuanSpecialAuthorInfo Err ", err, "userId", user.UserId), 2)
+		}
+	}()
+	var condition string
+	condition += ` AND a.status = 1 `
+	specialUser, e := models.GetYanxuanSpecialAuthor(user.UserId, user.UserId, condition)
+	if e != nil && e.Error() != utils.ErrNoRow() {
+		err = errors.New("GetYanxuanSpecialAuthor, Err: " + e.Error())
+		return
+	}
+	if specialUser != nil {
+		isAuthor = true
+		//如果昵称 、专栏名称、简介 都不为空就表示信息完善
+		if specialUser.SpecialName != "" && specialUser.Introduction != "" && specialUser.NickName != "" {
+			isImproveInformation = true
+		}
+	}
+	return
+}

+ 0 - 33
services/yanxuan_special.go

@@ -1,33 +0,0 @@
-package services
-
-import (
-	"errors"
-	"fmt"
-	"hongze/hongze_cygx/models"
-	"hongze/hongze_cygx/utils"
-)
-
-// 获取研选专栏用户信息
-func GetYanxuanSpecialAuthorInfo(user *models.WxUserItem) (isAuthor, isImproveInformation bool) {
-	var err error
-	defer func() {
-		if err != nil {
-			go utils.SendAlarmMsg(fmt.Sprint("获取研选专栏用户信息失败,GetYanxuanSpecialAuthorInfo Err ", err, "userId", user.UserId), 2)
-		}
-	}()
-	var condition string
-	condition += ` AND a.status = 1 `
-	specialUser, e := models.GetYanxuanSpecialAuthor(user.UserId, user.UserId, condition)
-	if e != nil && e.Error() != utils.ErrNoRow() {
-		err = errors.New("GetYanxuanSpecialAuthor, Err: " + e.Error())
-		return
-	}
-	if specialUser != nil {
-		isAuthor = true
-		//如果昵称 、专栏名称、简介 都不为空就表示信息完善
-		if specialUser.SpecialName != "" && specialUser.Introduction != "" && specialUser.NickName != "" {
-			isImproveInformation = true
-		}
-	}
-	return
-}