aa
This commit is contained in:
@@ -126,23 +126,33 @@ func NotifyPickOrder(order *model.GoodsOrder) (err error) {
|
||||
mobileList = append(mobileList, store.Tel2)
|
||||
}
|
||||
if order.NotifyType == 0 && store.SMSNotify != 0 && store.IsOrder == model.NO && store.ID != model.MatterStoreID && store.ID != model.JdShopMainStoreID && len(mobileList) > 0 {
|
||||
globals.SugarLogger.Debugf("NotifyPickOrder orderID: %s , smsNotify :%d", order.VendorOrderID, store.SMSNotify)
|
||||
switch store.SMSNotify {
|
||||
case model.NotifyTypeSMS:
|
||||
err = SendSMSMsg(mobileList, globals.SMSSignName, globals.SMSPickOrderTemplate, nil, order)
|
||||
if store.BrandIsOpen&model.BrandOpenSMS != 0 {
|
||||
if err = SendSMSMsg(mobileList, globals.SMSSignName, globals.SMSPickOrderTemplate, nil, order); err == nil {
|
||||
order.NotifyType = int(store.SMSNotify)
|
||||
partner.CurOrderManager.UpdateOrderFields(order, []string{"NotifyType"})
|
||||
}
|
||||
} else {
|
||||
globals.SugarLogger.Debugf("NotifyPickOrder sms brand is close , orderID: %s ,isOpen: %d", order.VendorOrderID, store.BrandIsOpen)
|
||||
}
|
||||
case model.NotifyTypeVoice:
|
||||
globals.SugarLogger.Debugf("NotifyPickOrder orderID: %s , smsNotify :%d", order.VendorOrderID, store.SMSNotify)
|
||||
if store.MarketManPhone == "" {
|
||||
store.MarketManPhone = "18048531223"
|
||||
}
|
||||
err = SendVoiceMsg(mobileList, map[string]interface{}{
|
||||
"tel": store.MarketManPhone,
|
||||
})
|
||||
if store.BrandIsOpen&model.BrandOpenVoice != 0 {
|
||||
if err = SendVoiceMsg(mobileList, map[string]interface{}{
|
||||
"tel": store.MarketManPhone,
|
||||
}); err == nil {
|
||||
order.NotifyType = int(store.SMSNotify)
|
||||
partner.CurOrderManager.UpdateOrderFields(order, []string{"NotifyType"})
|
||||
}
|
||||
} else {
|
||||
globals.SugarLogger.Debugf("NotifyPickOrder voice brand is close , orderID: %s ,isOpen: %d", order.VendorOrderID, store.BrandIsOpen)
|
||||
}
|
||||
}
|
||||
}
|
||||
if err == nil {
|
||||
order.NotifyType = int(store.SMSNotify)
|
||||
partner.CurOrderManager.UpdateOrderFields(order, []string{"NotifyType"})
|
||||
}
|
||||
//}
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user