浏览代码

Merge branch 'mfyx_3.7' of http://8.136.199.33:3000/hongze/hongze_web_mfyx into debug

zhangchuanxing 2 月之前
父节点
当前提交
913c26ae52

+ 2 - 1
.gitignore

@@ -11,4 +11,5 @@
 /hongze_web_mfyx
 .DS_Store
 /doc/
-*DS_Store
+*DS_Store
+cygxlogs/

+ 10 - 12
controllers/base_auth.go

@@ -11,20 +11,18 @@ import (
 
 	"hongze/hongze_web_mfyx/models"
 	"hongze/hongze_web_mfyx/utils"
-
-	"github.com/rdlucklib/rdluck_tools/log"
 )
 
-var apiLog *log.Log
+//var apiLog *log.Log
 
-func init() {
-	if utils.RunMode == "release" {
-		logDir := `/data/rdlucklog/hongze_clpt`
-		apiLog = log.Init("20060102.api", logDir)
-	} else {
-		apiLog = log.Init("20060102.api")
-	}
-}
+//func init() {
+//	if utils.RunMode == "release" {
+//		logDir := `/data/rdlucklog/hongze_clpt`
+//		apiLog = log.Init("20060102.api", logDir)
+//	} else {
+//		apiLog = log.Init("20060102.api")
+//	}
+//}
 
 type BaseAuthController struct {
 	web.Controller
@@ -139,7 +137,7 @@ func (c *BaseAuthController) JSON(data interface{}, hasIndent bool, coding bool)
 	}
 	ip := c.Ctx.Input.IP()
 	requestBody, _ := url.QueryUnescape(string(c.Ctx.Input.RequestBody))
-	apiLog.Println("请求地址:", c.Ctx.Input.URI(), "Authorization:", c.Ctx.Input.Header("Authorization"), "RequestBody:", requestBody, "ResponseBody", string(content), "IP:", ip)
+	//apiLog.Println("请求地址:", c.Ctx.Input.URI(), "Authorization:", c.Ctx.Input.Header("Authorization"), "RequestBody:", requestBody, "ResponseBody", string(content), "IP:", ip)
 	if coding {
 		content = []byte(utils.StringsToJSON(string(content)))
 	}

+ 9 - 11
controllers/base_auth_mobile.go

@@ -12,18 +12,16 @@ import (
 
 	"hongze/hongze_web_mfyx/models"
 	"hongze/hongze_web_mfyx/utils"
-
-	"github.com/rdlucklib/rdluck_tools/log"
 )
 
-func init() {
-	if utils.RunMode == "release" {
-		logDir := `/data/rdlucklog/hongze_cygx`
-		apiLog = log.Init("20060102.api", logDir)
-	} else {
-		apiLog = log.Init("20060102.api")
-	}
-}
+//func init() {
+//	if utils.RunMode == "release" {
+//		logDir := `/data/rdlucklog/hongze_cygx`
+//		apiLog = log.Init("20060102.api", logDir)
+//	} else {
+//		apiLog = log.Init("20060102.api")
+//	}
+//}
 
 type BaseAuthMobileController struct {
 	web.Controller
@@ -138,7 +136,7 @@ func (c *BaseAuthMobileController) JSON(data interface{}, hasIndent bool, coding
 	}
 	ip := c.Ctx.Input.IP()
 	requestBody, _ := url.QueryUnescape(string(c.Ctx.Input.RequestBody))
-	apiLog.Println("请求地址:", c.Ctx.Input.URI(), "Authorization:", c.Ctx.Input.Header("Authorization"), "RequestBody:", requestBody, "ResponseBody", string(content), "IP:", ip)
+	//apiLog.Println("请求地址:", c.Ctx.Input.URI(), "Authorization:", c.Ctx.Input.Header("Authorization"), "RequestBody:", requestBody, "ResponseBody", string(content), "IP:", ip)
 	if coding {
 		content = []byte(utils.StringsToJSON(string(content)))
 	}

+ 2 - 2
controllers/base_common.go

@@ -26,7 +26,7 @@ func (this *BaseCommonController) Prepare() {
 		requestBody, _ = url.QueryUnescape(string(this.Ctx.Input.RequestBody))
 	}
 	ip := this.Ctx.Input.IP()
-	apiLog.Println("请求地址:", this.Ctx.Input.URI(), "RequestBody:", requestBody, "IP:", ip)
+	//apiLog.Println("请求地址:", this.Ctx.Input.URI(), "RequestBody:", requestBody, "IP:", ip)
 
 	authorization := this.Ctx.Input.Header("Authorization")
 	if authorization == "" {
@@ -115,7 +115,7 @@ func (c *BaseCommonController) JSON(data interface{}, hasIndent bool, coding boo
 	}
 	ip := c.Ctx.Input.IP()
 	requestBody, _ := url.QueryUnescape(string(c.Ctx.Input.RequestBody))
-	apiLog.Println("请求地址:", c.Ctx.Input.URI(), "Authorization:", c.Ctx.Input.Header("Authorization"), "RequestBody:", requestBody, "ResponseBody", string(content), "IP:", ip)
+	//apiLog.Println("请求地址:", c.Ctx.Input.URI(), "Authorization:", c.Ctx.Input.Header("Authorization"), "RequestBody:", requestBody, "ResponseBody", string(content), "IP:", ip)
 
 	if coding {
 		content = []byte(utils.StringsToJSON(string(content)))

+ 1 - 0
controllers/yanxuan_special.go

@@ -341,6 +341,7 @@ func (this *YanxuanSpecialNoLoginController) Detail() {
 	//}
 	//resp.ShareImg = utils.YANXUAN_SPECIAL_SHARE_IMG
 	yanxuanDetail.ShareImg = yanxuanDetail.HeadImg
+	resp.ShareImg = yanxuanDetail.HeadImg
 	resp.IsShowWxPay = utils.IS_SHOW_WX_PAY                                                      //是否展示微信支付按钮
 	resp.IsCompanyApply = services.GetUserApplyRecordCountByCompanyIdPay(user.CompanyId)         //获取客户是否有过历史申请记录
 	resp.IsNeedBusinessCard = services.GetCygxUserBusinessCardCount(user.UserId, user.CompanyId) //是否需要上传名片

+ 8 - 0
models/resource_data.go

@@ -238,3 +238,11 @@ func UpdateResourceDataByItem(item *CygxResourceData) (err error) {
 	}
 	return
 }
+
+// 固收ID列表
+func GetResourceDataListGuShou() (items []*CygxResourceDataNewResp, err error) {
+	o := orm.NewOrm()
+	sql := `SELECT	 source_id   FROM cygx_resource_data  WHERE source = 'article'  AND chart_permission_id = 53  `
+	_, err = o.Raw(sql).QueryRows(&items)
+	return
+}

+ 13 - 2
services/article.go

@@ -136,8 +136,10 @@ func HandleArticleCategoryImg(list []*models.ArticleListResp, user *models.WxUse
 			list[k].IsResearch = true
 		}
 
-		//是不是研选报告
-		if v.ArticleTypeId > 0 {
+		if v.CategoryId != "0" {
+			list[k].LabelKeywordImgLink = utils.LABEL_ICO_11
+		} else if v.ArticleTypeId > 0 {
+			//是不是研选报告
 			list[k].IsResearch = true
 			if v.ArticleTypeId == 12 {
 				list[k].LabelKeywordImgLink = utils.LABEL_ICO_6
@@ -640,6 +642,15 @@ func GetYanxuanArticleIds() (articleIds []int) {
 	for _, v := range list {
 		articleIds = append(articleIds, v.ArticleId)
 	}
+
+	listGuShou, e := models.GetResourceDataListGuShou()
+	if e != nil {
+		err = errors.New("GetResourceDataListGuShou, Err: " + e.Error())
+		return
+	}
+	for _, v := range listGuShou {
+		articleIds = append(articleIds, v.SourceId)
+	}
 	return
 }
 

+ 1 - 0
utils/constants.go

@@ -312,6 +312,7 @@ const (
 	LABEL_ICO_8  string = "https://hzstatic.hzinsights.com/mfyx/config/yueka.png"                        // 月卡图标
 	LABEL_ICO_9  string = "https://hzstatic.hzinsights.com/cygx_web/config/zhuanlan_author.png"          // 专栏作者
 	LABEL_ICO_10 string = "https://hzstatic.hzinsights.com/cygx_web/config/activity_vivo.png"            // 专栏作者
+	LABEL_ICO_11 string = "https://hzstatic.hzinsights.com/cygx_web/config/gushou.png"                   // 固收
 )
 
 const (

+ 5 - 5
utils/logs.go

@@ -22,10 +22,10 @@ import (
 //	}
 
 const (
-	DefaultLogPath    = "./hongze_cygx/filelog"
-	DefaultBinlogPath = "./hongze_cygx/binlog"
-	DefaultDataPath   = "./hongze_cygx/datalog"
-	DefaultApiLogPath = "./hongze_cygx/apilog"
+	DefaultLogPath    = "./cygxlogs/filelog"
+	DefaultBinlogPath = "./cygxlogs/binlog"
+	DefaultDataPath   = "./cygxlogs/datalog"
+	DefaultApiLogPath = "./cygxlogs/apilog"
 )
 
 var FileLog *logs.BeeLogger
@@ -35,7 +35,7 @@ var Binlog *logs.BeeLogger
 
 func init() {
 	if LogMaxDays == 0 {
-		LogMaxDays = 30
+		LogMaxDays = 7
 	}
 	logPath := LogPath
 	if logPath == "" {