|
@@ -6,6 +6,7 @@ import (
|
|
|
"hongze/hongze_clpt/models"
|
|
|
"hongze/hongze_clpt/utils"
|
|
|
"strconv"
|
|
|
+ "strings"
|
|
|
"time"
|
|
|
)
|
|
|
|
|
@@ -52,26 +53,51 @@ func SendArticleApplyAppointmentExpertTemplateMsg(user *models.WxUserItem, artic
|
|
|
go utils.SendAlarmMsg("活动带问提醒发送模版消息失败"+msg, 2)
|
|
|
}
|
|
|
}()
|
|
|
+
|
|
|
+ detailArticle, e := models.GetArticleDetailById(articleId)
|
|
|
+ if e != nil {
|
|
|
+ err = errors.New("GetArticleDetailById, Err: " + e.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ var mobiles []string
|
|
|
|
|
|
- sellerItem, err := models.GetSellerByCompanyIdCheckFicc(user.CompanyId, 2)
|
|
|
- if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ sellerItem, e := models.GetSellerByCompanyIdCheckFicc(user.CompanyId, 2)
|
|
|
+ if e != nil {
|
|
|
+ err = errors.New("GetAdminByRoleName, Err: " + e.Error())
|
|
|
return
|
|
|
}
|
|
|
- if sellerItem == nil {
|
|
|
+
|
|
|
+ configCode := utils.TPL_MSG_NEI_RONG_ZU
|
|
|
+ cnf, e := models.GetConfigByCode(configCode)
|
|
|
+ if e != nil {
|
|
|
+ err = errors.New("GetConfigByCode, Err: " + e.Error() + configCode)
|
|
|
return
|
|
|
}
|
|
|
-
|
|
|
- detailArticle, e := models.GetArticleDetailById(articleId)
|
|
|
+
|
|
|
+
|
|
|
+ cnfWangYang, e := models.GetConfigByCode(utils.TPL_MSG_WANG_YANG)
|
|
|
if e != nil {
|
|
|
- err = errors.New("GetArticleDetailById, Err: " + e.Error())
|
|
|
+ err = errors.New("GetConfigByCode, Err: " + e.Error() + configCode)
|
|
|
return
|
|
|
}
|
|
|
-
|
|
|
- openIdList, e := models.GetWxOpenIdByMobileList(sellerItem.Mobile)
|
|
|
+
|
|
|
+ mobiles = append(mobiles, sellerItem.Mobile)
|
|
|
+ mobiles = append(mobiles, cnfWangYang.ConfigValue)
|
|
|
+ listMobile := strings.Split(cnf.ConfigValue, ",")
|
|
|
+ for _, v := range listMobile {
|
|
|
+ mobiles = append(mobiles, v)
|
|
|
+ }
|
|
|
+
|
|
|
+ openIdList, e := models.GetWxOpenIdByMobileSliceList(mobiles)
|
|
|
if e != nil {
|
|
|
- err = errors.New("GetWxOpenIdByMobileList, Err: " + e.Error())
|
|
|
+ err = errors.New("GetWxOpenIdByMobileSliceList, Err: " + e.Error() + configCode)
|
|
|
return
|
|
|
}
|
|
|
+ if len(openIdList) == 0 {
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
if len(openIdList) == 0 {
|
|
|
return
|
|
|
}
|