This commit is contained in:
richboo111
2023-07-12 17:09:03 +08:00
parent 6ab899ea0d
commit 58da22323f

View File

@@ -182,6 +182,7 @@ func pushMsgByUniApp(storeId int, storeName string, cID []string, msg string, bo
var (
errs []error
options = make(map[string]interface{}, 0)
offMsg MsgContext
)
if flag == FlagOrder {
options = map[string]interface{}{
@@ -214,6 +215,9 @@ func pushMsgByUniApp(storeId int, storeName string, cID []string, msg string, bo
},
}
}
if err := json.Unmarshal([]byte(body), &offMsg); err != nil {
globals.SugarLogger.Debugf("pushMsgByUniApp marshal err")
}
for _, v := range cID {
param := map[string]interface{}{
"request_id": utils.Int64ToStr(time.Now().Unix()) + "_" + utils.Int2Str(storeId),
@@ -231,10 +235,9 @@ func pushMsgByUniApp(storeId int, storeName string, cID []string, msg string, bo
"ups": map[string]interface{}{
"notification": map[string]interface{}{
"title": storeName,
"body": msg,
"body": offMsg.Context + "(" + offMsg.VendorName + offMsg.OrderSqs + "号订单)",
"click_type": "startapp",
//"notify_id": rand.Intn(1000000000),
"notify_id": time.Now().Unix(), // 每次通知需要不一样 范围0-2147483647
"notify_id": time.Now().Unix(), // 每次通知需要不一样 范围0-2147483647
},
"options": options,
},