Browse Source

Merge branch 'need/cygx_999' of http://8.136.199.33:3000/cxzhang/hongze_clpt into debug

xingzai 5 months ago
parent
commit
8bfe0af8a6

+ 1 - 0
controllers/home.go

@@ -307,6 +307,7 @@ func (this *MobileHomeController) NewList() {
 	//行业筛选
 	if chartPermissionId > 0 {
 		conditionInit += " AND chart_permission_id  =  " + strconv.Itoa(chartPermissionId)
+		condition += " AND chart_permission_id  =  " + strconv.Itoa(chartPermissionId)
 	}
 
 	//if tagIds == "" && chartPermissionId == 0 {

+ 2 - 0
models/seller.go

@@ -18,6 +18,7 @@ type AdminItem struct {
 	OpenId         string `description:"openId"`
 	CompanyName    string `description:"客户名称"`
 	UserId         int    `description:"联系人id"`
+	ShareSellerId  int    `description:"联系人id"`
 }
 
 func GetSellerByCompanyId(companyId int) (item *AdminItem, err error) {
@@ -95,6 +96,7 @@ func GetAdminListByGroupId(groupId int) (items []*Admin, err error) {
 func GetRaiSellerByCompanyId(companyId int) (item *AdminItem, err error) {
 	o := orm.NewOrmUsingDB("weekly_report")
 	sql := ` SELECT
+    		a.share_seller_id,
      		b.admin_id,
 			b.real_name,
 			b.mobile 

+ 3 - 1
services/ficc_reporrt.go

@@ -327,7 +327,9 @@ func GetReportDetail(userinfo *models.WxUserItem, reportId int) (reportDetail fi
 	reportItem.CanvasColor = reportInfo.CanvasColor
 	reportItem.ArticleId = detailArticle.ArticleId
 	reportItem.Disclaimer = GetConfigCodeDisclaimer()
-
+	if reportInfo.ClassifyNameFirst == "晨会纪要" && reportInfo.ClassifyNameSecond == "晨会纪要" {
+		reportItem.Title = "FICC/周期品晨会纪要"
+	}
 	//版头版尾样式
 	{
 		if reportInfo.HeadResourceId > 0 {

+ 9 - 4
services/tag.go

@@ -96,7 +96,6 @@ func GetConditionInitByTagIds(tagIds string, chartPermissionId int) (conditionIn
 			tagType = tagInfo.TagType
 		}
 	}
-
 	switch tagType {
 	case 0: // 无固定标签
 		//拼接search_tag 搜索内容
@@ -182,8 +181,9 @@ func GetConditionInitByTagIds(tagIds string, chartPermissionId int) (conditionIn
 				resourceDataIdStrs = append(resourceDataIdStrs, strconv.Itoa(v))
 				resourceDataIdMap[v] = true
 			}
-			conditionInit += " AND id IN  (" + strings.Join(resourceDataIdStrs, ",") + ") "
+			conditionInit += " AND id IN  (" + strings.Join(resourceDataIdStrs, ",") + ")   "
 		}
+		//conditionInit += "	OR   IF    ( source IN ('ficcreport') , tag_name IN ('纪要')  ,1=1 ) "
 	case 1: // 热门活动
 		conf, e := models.GetConfigByCode(utils.CYGX_TAG_HOT_ACTIVITY_ID)
 		if e != nil {
@@ -258,7 +258,12 @@ func GetConditionInitByTagIds(tagIds string, chartPermissionId int) (conditionIn
 		conditionInit = "   AND source = '" + utils.CYGX_OBJ_ASKSERIEVIDEO + "'"
 
 	case 5: //固定标签【跟踪】,包含以下系列:医药-趋势观察 ,科技-产业跟踪 ,智造-产业跟踪 ,消费-月度调研 ,周期-(周度观点,产业跟踪)
-		condition = " AND sub_category_name  IN ('趋势观察','产业跟踪','月度调研')  AND category_name IN ('医药行业','智造行业','消费行业','科技行业') OR  ( sub_category_name IN  ('周度观点','产业跟踪')  AND  category_name  = '周期' )  AND publish_status = 1 "
+		condition = `   AND category_name IN ( '医药行业', '智造行业', '消费行业', '科技行业', '周期' )  
+						AND IF  ( category_name IN ( '医药行业' ), sub_category_name IN ( '趋势观察' ), 1 = 1 ) 
+						AND IF	( category_name IN ( '科技行业' ), sub_category_name IN ( '产业跟踪' ), 1 = 1 ) 
+						AND IF	( category_name IN ( '智造行业' ), sub_category_name IN ( '产业跟踪' ), 1 = 1 ) 
+						AND IF	( category_name IN ( '消费行业' ), sub_category_name IN ( '月度调研' ), 1 = 1 ) 
+						AND IF	( category_name IN ( '周期' ), sub_category_name IN ( '周度观点', '产业跟踪' ), 1 = 1 ) AND publish_status = 1 `
 		pars = make([]interface{}, 0)
 		articleList, e := models.GetArticleList(condition, pars)
 		if e != nil {
@@ -270,7 +275,7 @@ func GetConditionInitByTagIds(tagIds string, chartPermissionId int) (conditionIn
 		for _, v := range articleList {
 			articleIds = append(articleIds, strconv.Itoa(v.ArticleId))
 		}
-		conditionInit = "  AND source_id IN ( " + strings.Join(articleIds, ",") + ")  AND source = '" + utils.CYGX_OBJ_ARTICLE + "'"
+		conditionInit = " AND source IN ('article','ficcreport')  AND  IF (  source = 'article'  , source_id IN ( " + strings.Join(articleIds, ",") + ")  ,1=1 )  AND IF   ( source =  'ficcreport' , tag_name IN ('跟踪')  ,1=1 )  "
 	}
 
 	return

+ 11 - 1
services/wechat_send_category_template_msg.go

@@ -522,7 +522,17 @@ func SendPermissionApplyTemplateMsgAdminByYxCategory(req models.ApplyTryReq, com
 				err = errors.New("GetRaiSellerByCompanyId, Err: " + e.Error())
 				return
 			}
-			mobileOpneid = sealldetail.Mobile
+			//如果有共享销售给共享销售也推模版消息
+			if sealldetail.ShareSellerId > 0 {
+				adminShare, e := models.GetSellerByAdminId(sealldetail.ShareSellerId)
+				if e != nil {
+					err = errors.New("GetSellerByAdminId, Err: " + e.Error())
+					return
+				}
+				mobileOpneid = sealldetail.Mobile + "," + adminShare.Mobile
+			} else {
+				mobileOpneid = sealldetail.Mobile
+			}
 		}
 	}
 

+ 11 - 1
services/wechat_send_msg.go

@@ -101,7 +101,17 @@ func SendPermissionApplyTemplateMsg(realName, companyName, mobile, applyMethod,
 			err = errors.New("GetRaiSellerByCompanyId, Err: " + e.Error())
 			return
 		}
-		mobileOpenid = sealldetail.Mobile
+		//如果有共享销售给共享销售也推模版消息
+		if sealldetail.ShareSellerId > 0 {
+			adminShare, e := models.GetSellerByAdminId(sealldetail.ShareSellerId)
+			if e != nil {
+				err = errors.New("GetSellerByAdminId, Err: " + e.Error())
+				return
+			}
+			mobileOpenid = sealldetail.Mobile + "," + adminShare.Mobile
+		} else {
+			mobileOpenid = sealldetail.Mobile
+		}
 	}
 
 	openIdList, e := models.GetWxOpenIdByMobileList(mobileOpenid)