|
@@ -40,8 +40,9 @@ func AddCygxTagHistory(user *models.WxUserItem, tagId int) (err error) {
|
|
|
}
|
|
|
|
|
|
//func init() {
|
|
|
-// conditionInit, err := GetConditionInitByTagIds("20,21,26")
|
|
|
+// conditionInit, err := GetConditionInitByTagIds("43")
|
|
|
// fmt.Println(err)
|
|
|
+// fmt.Println()
|
|
|
// fmt.Println(conditionInit)
|
|
|
//}
|
|
|
|
|
@@ -64,16 +65,30 @@ func GetConditionInitByTagIds(tagIds string) (conditionInit string, err error) {
|
|
|
for _, tagInfo := range listTag {
|
|
|
//ActivityTypes 与 ArticleTypes 进行合并
|
|
|
if tagInfo.ActivityTypes != "" {
|
|
|
- searchTag = append(searchTag, tagInfo.ActivityTypes)
|
|
|
+ sliceObj := strings.Split(tagInfo.ActivityTypes, ",")
|
|
|
+ for _, v := range sliceObj {
|
|
|
+ searchTag = append(searchTag, v)
|
|
|
+ }
|
|
|
}
|
|
|
if tagInfo.ArticleTypes != "" {
|
|
|
- searchTag = append(searchTag, tagInfo.ArticleTypes)
|
|
|
+ sliceObj := strings.Split(tagInfo.ArticleTypes, ",")
|
|
|
+ for _, v := range sliceObj {
|
|
|
+ searchTag = append(searchTag, v)
|
|
|
+ }
|
|
|
}
|
|
|
if tagInfo.Industries != "" {
|
|
|
- industries = append(industries, tagInfo.Industries)
|
|
|
+ sliceObj := strings.Split(tagInfo.Industries, ",")
|
|
|
+ for _, v := range sliceObj {
|
|
|
+ industries = append(industries, v)
|
|
|
+ }
|
|
|
+ //industries = append(industries, tagInfo.Industries)
|
|
|
}
|
|
|
if tagInfo.SubjectNames != "" {
|
|
|
- subjectNames = append(subjectNames, tagInfo.SubjectNames)
|
|
|
+ sliceObj := strings.Split(tagInfo.SubjectNames, ",")
|
|
|
+ for _, v := range sliceObj {
|
|
|
+ subjectNames = append(subjectNames, v)
|
|
|
+ }
|
|
|
+ //subjectNames = append(subjectNames, tagInfo.SubjectNames)
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -85,7 +100,6 @@ func GetConditionInitByTagIds(tagIds string) (conditionInit string, err error) {
|
|
|
var resourceDataIds []int //cygx_resource_data 主键ID
|
|
|
//如果产业有组合,那么就去捞产业相关的内容
|
|
|
if len(industries) > 0 {
|
|
|
- // 获取近一个月产业报告阅读次数最多的产业
|
|
|
var conditionIndustry string
|
|
|
var parsIndustry []interface{}
|
|
|
conditionIndustry += " AND industry_name IN ('" + strings.Join(industries, "','") + "')"
|
|
@@ -120,11 +134,10 @@ func GetConditionInitByTagIds(tagIds string) (conditionInit string, err error) {
|
|
|
//return
|
|
|
//如果标的有组合,那么就去捞标的相关的内容
|
|
|
if len(subjectNames) > 0 {
|
|
|
- // 获取近一个月产业报告阅读次数最多的产业
|
|
|
var conditionsubject string
|
|
|
var parssubject []interface{}
|
|
|
conditionsubject += " AND subject_name IN ('" + strings.Join(subjectNames, "','") + "')"
|
|
|
- listsubject, e := models.GetCygxIndustrialSubjectList(conditionsubject, parssubject)
|
|
|
+ listsubject, e := models.GetCygxIndustrialSubjectListCondition(conditionsubject, parssubject)
|
|
|
if e != nil {
|
|
|
err = errors.New("GetTopOneMonthArtReadNumIndustry, Err: " + e.Error())
|
|
|
return
|