|
@@ -693,14 +693,12 @@ func GetArticleListByApi(cont context.Context) (err error) {
|
|
activityIdStr += strconv.Itoa(vAct.ActivityId) + ","
|
|
activityIdStr += strconv.Itoa(vAct.ActivityId) + ","
|
|
}
|
|
}
|
|
activityIdStr = strings.TrimRight(activityIdStr, ",")
|
|
activityIdStr = strings.TrimRight(activityIdStr, ",")
|
|
- fmt.Println(activityIdStr)
|
|
|
|
if activityIdStr != "" {
|
|
if activityIdStr != "" {
|
|
- appointmentList, err := models.GetAppointmentListByActivityId(activityIdStr)
|
|
|
|
|
|
+ appointmentList, err := models.GetAppointmentListByActivityId(activityIdStr, "1,2,5")
|
|
if err != nil {
|
|
if err != nil {
|
|
fmt.Println("GetAppointmentListByActivityId Err:", err.Error())
|
|
fmt.Println("GetAppointmentListByActivityId Err:", err.Error())
|
|
return err
|
|
return err
|
|
}
|
|
}
|
|
- fmt.Println("预约", appointmentList)
|
|
|
|
if len(appointmentList) > 0 {
|
|
if len(appointmentList) > 0 {
|
|
for _, vApp := range appointmentList {
|
|
for _, vApp := range appointmentList {
|
|
|
|
|
|
@@ -722,13 +720,11 @@ func GetArticleListByApi(cont context.Context) (err error) {
|
|
fmt.Println(err)
|
|
fmt.Println(err)
|
|
return err
|
|
return err
|
|
}
|
|
}
|
|
-
|
|
|
|
keyword1 := "您预约的调研,有关联的纪要发布/更新了"
|
|
keyword1 := "您预约的调研,有关联的纪要发布/更新了"
|
|
keyword2 := appointmentActivityName
|
|
keyword2 := appointmentActivityName
|
|
keyword3 := v.Title
|
|
keyword3 := v.Title
|
|
keyword4 := v.PublishDate.Format(utils.FormatDateTime)
|
|
keyword4 := v.PublishDate.Format(utils.FormatDateTime)
|
|
SendWxMsgWithArticleClassToAdmin(keyword1, keyword2, keyword3, keyword4, openIdListByAppointment, articleIdInt)
|
|
SendWxMsgWithArticleClassToAdmin(keyword1, keyword2, keyword3, keyword4, openIdListByAppointment, articleIdInt)
|
|
- fmt.Println(openIdListByAppointment)
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -736,8 +732,72 @@ func GetArticleListByApi(cont context.Context) (err error) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ }
|
|
|
|
+ //【公司调研】系列纪要发布/更新后
|
|
|
|
+ if v.CategoryId == 45 || v.CategoryId == 74 || v.CategoryId == 86 || v.CategoryId == 88 {
|
|
|
|
+ sliceSubjects := strings.Split(v.Stock, "/")
|
|
|
|
+ if len(sliceSubjects) > 0 {
|
|
|
|
+ var subjectStr string
|
|
|
|
+ for _, vSubject := range sliceSubjects {
|
|
|
|
+ sliceKuohao := strings.Split(vSubject, "(") //过滤括号
|
|
|
|
+ sliceXiahuaxian := strings.Split(sliceKuohao[0], "-") //过滤下划线
|
|
|
|
+ subject := sliceXiahuaxian[0]
|
|
|
|
+ subjectStr += "'" + subject + "',"
|
|
|
|
+ }
|
|
|
|
+ if subjectStr != "" {
|
|
|
|
+ subjectStr = strings.TrimRight(subjectStr, ",")
|
|
|
|
+ activityIdList, err := models.GetActivityIdListBySubjecName(subjectStr)
|
|
|
|
+ if err != nil {
|
|
|
|
+ fmt.Println("GetActivityIdListBySubjecName Err:", err.Error())
|
|
|
|
+ return err
|
|
|
|
+ }
|
|
|
|
+ if len(activityIdList) > 0 {
|
|
|
|
+ var activityIdStr string
|
|
|
|
+ for _, vAct := range activityIdList {
|
|
|
|
+ activityIdStr += strconv.Itoa(vAct.ActivityId) + ","
|
|
|
|
+ }
|
|
|
|
+ activityIdStr = strings.TrimRight(activityIdStr, ",")
|
|
|
|
+ if activityIdStr != "" {
|
|
|
|
+ appointmentList, err := models.GetAppointmentListByActivityId(activityIdStr, "3,4")
|
|
|
|
+ if err != nil {
|
|
|
|
+ fmt.Println("GetAppointmentListByActivityId Err:", err.Error())
|
|
|
|
+ return err
|
|
|
|
+ }
|
|
|
|
+ if len(appointmentList) > 0 {
|
|
|
|
+ for _, vApp := range appointmentList {
|
|
|
|
+ appointmentByMobileList, err := models.GetAppointmentListByActivityIdAndMobile(activityIdStr, vApp.Mobile)
|
|
|
|
+ if err != nil {
|
|
|
|
+ fmt.Println("GetAppointmentListByActivityId Err:", err.Error())
|
|
|
|
+ return err
|
|
|
|
+ }
|
|
|
|
+ var appointmentActivityName string
|
|
|
|
+ if len(appointmentByMobileList) > 0 {
|
|
|
|
+ for _, vAppM := range appointmentByMobileList {
|
|
|
|
+ appointmentActivityName += vAppM.ActivityName + ","
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ appointmentActivityName = strings.TrimRight(appointmentActivityName, ",")
|
|
|
|
+ if vApp.Mobile != "" {
|
|
|
|
+ openIdListByAppointment, err := models.GetUserRecordListByMobile(4, vApp.Mobile)
|
|
|
|
+ if err != nil {
|
|
|
|
+ fmt.Println(err)
|
|
|
|
+ return err
|
|
|
|
+ }
|
|
|
|
+ keyword1 := "您预约的调研,有关联的纪要发布/更新了"
|
|
|
|
+ keyword2 := appointmentActivityName
|
|
|
|
+ keyword3 := v.Title
|
|
|
|
+ keyword4 := v.PublishDate.Format(utils.FormatDateTime)
|
|
|
|
+ SendWxMsgWithArticleClassToAdmin(keyword1, keyword2, keyword3, keyword4, openIdListByAppointment, articleIdInt)
|
|
|
|
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+ //【公司调研】系列纪要发布/更新后 end
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return
|
|
return
|