1
This commit is contained in:
@@ -20,7 +20,7 @@ const (
|
||||
SoundsFileNewOrder = "newOrder.caf"
|
||||
SoundsFileNewAfsOrder = "afsOrder.caf"
|
||||
SoundsFileNewCancelOrder = "cancelOrder.caf"
|
||||
SoundsFileNewImMsg = "" //TODO 待定
|
||||
SoundsFileNewImMsg = "newMsg.caf"
|
||||
)
|
||||
|
||||
// NotifyNewOrder 推送新订单
|
||||
@@ -116,19 +116,11 @@ func NotifyImNewMessage(vendorStoreID string, vendorID int) error {
|
||||
if len(vendorStoreID) == 0 {
|
||||
return nil
|
||||
}
|
||||
var (
|
||||
temp = 0
|
||||
msg = MsgContext{}
|
||||
)
|
||||
if vendorID == 10 { //美团
|
||||
temp = 1
|
||||
} else if vendorID == 11 { //饿了么
|
||||
temp = 3
|
||||
}
|
||||
var msg = MsgContext{}
|
||||
|
||||
store, err := dao.GetStoreBaseByVendorStoreID(vendorStoreID, temp)
|
||||
store, err := dao.GetStoreBaseByVendorStoreID(vendorStoreID, vendorID)
|
||||
if err != nil {
|
||||
return fmt.Errorf("未查到此门店:%s", vendorStoreID)
|
||||
return fmt.Errorf("未查到此门店/门店未与平台正常绑定:%s", vendorStoreID)
|
||||
}
|
||||
|
||||
cid, err := GetStoreBoosCID(store.ID)
|
||||
@@ -138,13 +130,12 @@ func NotifyImNewMessage(vendorStoreID string, vendorID int) error {
|
||||
}
|
||||
fmt.Print(cid)
|
||||
msg.MsgType = "newImMsg"
|
||||
msg.VendorName = model.VendorChineseNames[temp]
|
||||
msg.VendorName = model.VendorChineseNames[vendorID]
|
||||
msg.StoreTitle = store.Name
|
||||
msg.Context = "老板,你有新的用户消息,请及时查看!"
|
||||
context, _ := json.Marshal(msg)
|
||||
body := fmt.Sprintf(msg.Context+"(%s)", model.VendorChineseNames[temp])
|
||||
|
||||
pushMsgByUniApp(store.ID, store.Name, cid, string(context), body, SoundsFileNewImMsg)
|
||||
pushMsgByUniApp(store.ID, store.Name, cid, string(context), "", SoundsFileNewImMsg)
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user