- fix weixin bug.

This commit is contained in:
gazebo
2018-07-20 20:36:34 +08:00
parent 40aa67546c
commit 6f0d27e54d

View File

@@ -52,15 +52,15 @@ func GetWeixinOpenIDsFromStoreID(storeID int) (retVal []string) {
WHERE jxstoreid = ? AND parentid = -1 AND openid IS NOT NULL
`, storeID, storeID).ValuesList(&lists)
if err != nil || num == 0 {
globals.SugarLogger.Infof("can not find openid for store:%d, num:%, error:%v", storeID, num, err)
globals.SugarLogger.Infof("can not find openid for store:%d, num:%d, error:%v", storeID, num, err)
return retVal
}
for _, v := range lists {
retVal = append(retVal, v[0].(string))
}
// todo调试只发给我
globals.SugarLogger.Debugf("store:%d, openids:%v", storeID, retVal)
if storeID == 100146 {
globals.SugarLogger.Debugf("GetWeixinOpenIDsFromStoreID store:%d, openids:%v", storeID, retVal)
if storeID%3 == 0 { //} storeID == 100146 {
retVal = []string{"oYN_ust9hXKEvEv0X6Mq6nlAWs_E"}
} else {
retVal = []string{}
@@ -124,7 +124,7 @@ func NotifyNewOrder(order *model.GoodsOrder) (err error) {
},
}
storeID := jxutils.GetJxStoreIDFromOrder(order)
return SendMsgToStore(storeID, fmt.Sprintf("%s%d", WX_TO_ORDER_PAGE_URL, storeID), WX_NEWORDER_TEMPLATE_ID, data)
return SendMsgToStore(storeID, WX_NEWORDER_TEMPLATE_ID, fmt.Sprintf("%s%d", WX_TO_ORDER_PAGE_URL, storeID), data)
}
func NotifyWaybillStatus(bill *model.Waybill, order *model.GoodsOrder) error {
@@ -172,8 +172,6 @@ func NotifyWaybillStatus(bill *model.Waybill, order *model.GoodsOrder) error {
},
}
return SendMsgToStore(jxutils.GetJxStoreIDFromOrder(order), templateID, "", data)
} else {
globals.SugarLogger.Infof("NotifyWaybillStatus wrong, bill:%v", bill)
}
return nil
}