This commit is contained in:
苏尹岚
2021-02-24 11:53:26 +08:00
parent 3d240a86a1
commit 04839ce472
3 changed files with 11 additions and 15 deletions

View File

@@ -4023,9 +4023,9 @@ func StoreConfirmAct(ctx *jxcontext.Context, status, msgStatusID int) (err error
if err = dao.GetEntity(db, msg); err != nil {
return err
}
actMap := make(map[string]interface{})
actMap := &model.MessageActInfo{}
err = json.Unmarshal([]byte(msg.ActInfo), &actMap)
if time.Now().Sub(utils.Str2Time(actMap["beginAt"].(string))) > 0 {
if time.Now().Sub(utils.Str2Time(actMap.BeginAt)) > 0 {
msgStatus.ConfirmStatus = -1
dao.WrapUpdateULEntity(msgStatus, ctx.GetUserName())
_, err = dao.UpdateEntity(db, msgStatus, "ConfirmStatus")

View File

@@ -632,7 +632,7 @@ func NotifyStoreMessage(storeID, msgID, msgStatusID int, msg *model.Message) (er
},
}
case model.MessageTypeStoreAct:
actMap := make(map[string]interface{})
actMap := &model.MessageActInfo{}
err = json.Unmarshal([]byte(msg.ActInfo), &actMap)
templateID = WX_NORMAL_STORE_ACT_MSG_TEMPLATE_ID
data = map[string]interface{}{
@@ -645,11 +645,11 @@ func NotifyStoreMessage(storeID, msgID, msgStatusID int, msg *model.Message) (er
"color": "#2E408E",
},
"keyword2": map[string]interface{}{
"value": actMap["beginAt"].(string) + "-" + actMap["endAt"].(string),
"value": actMap.BeginAt + "-" + actMap.EndAt,
"color": "#2E408E",
},
"keyword3": map[string]interface{}{
"value": model.VendorNames[int(utils.Interface2Float64WithDefault((actMap["vendorID"]), 0))],
"value": model.VendorNames[int(utils.Interface2Float64WithDefault((actMap.VendorID), 0))],
"color": "#2E408E",
},
"remark": map[string]interface{}{

View File

@@ -1,9 +1,5 @@
package model
import (
"time"
)
const (
MessageTypeStore = 1
MessageTypeUser = 2
@@ -41,12 +37,6 @@ func (*Message) TableIndex() [][]string {
}
}
type MessageActInfo struct {
BeginAt time.Time `json:"beginAt"`
EndAt time.Time `json:"endAt"`
VendorID int `orm:"column(vendor_id)" json:"vendorID"`
}
type MessageStatus struct {
ModelIDCULD
MessageID int `orm:"column(message_id)" json:"messageID"`
@@ -64,6 +54,12 @@ func (*MessageStatus) TableIndex() [][]string {
}
}
type MessageActInfo struct {
VendorID int `orm:"colmun(vendor_id)" json:"vendorID"`
BeginAt string `json:"beginAt"`
EndAt string `json:"endAt"`
}
type ImMessageRecord struct {
ModelIDCULD
UserID string `orm:"size(48);column(user_id)" json:"userID"` //消息发送方userID