This commit is contained in:
邹宗楠
2023-04-06 18:39:05 +08:00
parent f2571c61a5
commit 747a5f3326

View File

@@ -45,8 +45,9 @@ func NotifyNewOrder(order *model.GoodsOrder) {
msg.OrderSqs = utils.Int2Str(order.OrderSeq)
msg.StoreTitle = storeDetail.Name
msg.Context = "老板,你有新的订单了!"
msg.VendorOrderId = order.VendorOrderID
context, _ := json.Marshal(msg)
body := fmt.Sprintf(msg.Context+"(%s)", model.VendorChineseNames[order.VendorID]+"#"+msg.OrderSqs+"订单Id:"+order.VendorOrderID)
body := fmt.Sprintf(msg.Context+"(%s)", model.VendorChineseNames[order.VendorID]+"#"+msg.OrderSqs)
pushMsgByUniApp(storeDetail.ID, storeDetail.Name, cid, string(context), body, SoundsFileNewOrder)
}
@@ -136,11 +137,12 @@ func GetStoreBoosCID(storeId int) ([]string, error) {
}
type MsgContext struct {
MsgType string `json:"msg_type"` // 订单类型[新订单/售后单/取消单]
StoreTitle string `json:"store_title"` // 门店名称
Context string `json:"context"` // 消息文本
VendorName string `json:"vendor_name"` // 平台名称
OrderSqs string `json:"order_sqs"` // 订单流水号
MsgType string `json:"msg_type"` // 订单类型[新订单/售后单/取消单]
StoreTitle string `json:"store_title"` // 门店名称
Context string `json:"context"` // 消息文本
VendorName string `json:"vendor_name"` // 平台名称
OrderSqs string `json:"order_sqs"` // 订单流水号
VendorOrderId string `json:"vendor_order_id"` // 订单id
}
func pushMsgByUniApp(storeId int, storeName string, cID []string, msg string, body string, soundsFileName string) {