This commit is contained in:
邹宗楠
2024-07-18 09:51:46 +08:00
parent 63be0e54f6
commit f687507516
3 changed files with 19 additions and 6 deletions

View File

@@ -101,8 +101,15 @@ func (c *OrderManager) OnOrderComments(orderCommentList []*model.OrderComment) (
comment2.Status = COMMENT_NOT_RESOLVED
comment2.OrderFlag = utils.Int2Str(orderComment.VendorID)
comment2.Maxmodifytime = int(orderComment.ModifyDuration)
comment2.VendorOrderId = orderComment.VendorOrderID2
var order *model.GoodsOrder
if orderComment.VendorID == model.VendorIDMTWM {
order, _ = partner.CurOrderManager.LoadOrder(orderComment.VendorOrderID2, orderComment.VendorID)
} else {
order, _ = partner.CurOrderManager.LoadOrder(orderComment.VendorOrderID, orderComment.VendorID)
}
order, _ := partner.CurOrderManager.LoadOrder(orderComment.VendorOrderID, orderComment.VendorID)
if order != nil {
orderComment.StoreID = jxutils.GetSaleStoreIDFromOrder(order)
if order.ConsigneeMobile2 != "" {
@@ -141,7 +148,7 @@ func (c *OrderManager) OnOrderComments(orderCommentList []*model.OrderComment) (
comment2.UpdatedScorecontent = orderComment.Content
comment2.UpdatedVendertags = orderComment.TagList
comment2.Status = COMMENT_RESOLVED
comment2.VendorOrderId = orderComment.VendorOrderID2
if comment2.Jxstoreid != "" && orderComment.Score <= JX_MIDDLE_COMMENTS_MAX_LEVEL && time.Now().Sub(orderComment.CommentCreatedAt) < MAX_REAPLY_TIME {
comment2.LastPushTime = utils.Time2Str(time.Now())
comment2.PushNo++
@@ -151,7 +158,13 @@ func (c *OrderManager) OnOrderComments(orderCommentList []*model.OrderComment) (
comment3.Score = comment2.UpdatedScore
comment3.Scorecontent = comment2.UpdatedScorecontent
comment3.Vendertags = comment2.UpdatedVendertags
order, _ := partner.CurOrderManager.LoadOrder(orderComment.VendorOrderID, orderComment.VendorID)
var order *model.GoodsOrder
if orderComment.VendorID == model.VendorIDMTWM {
order, _ = partner.CurOrderManager.LoadOrder(orderComment.VendorOrderID2, orderComment.VendorID)
} else {
order, _ = partner.CurOrderManager.LoadOrder(orderComment.VendorOrderID, orderComment.VendorID)
}
weixinmsg.PushJDBadCommentToWeiXin(&comment3, orderComment.Score <= JX_BAD_COMMENTS_MAX_LEVEL, order)
}
}

View File

@@ -5,7 +5,8 @@ import "time"
type JxBadComments struct {
Id int `json:"id" orm:"column(id)"`
CreatedAt time.Time `orm:"auto_now_add;type(datetime);null" json:"createdAt"`
OrderId string `json:"order_id" orm:"column(order_id);size(25);unique" description:"订单ID"`
OrderId string `json:"order_id" orm:"column(order_id);size(25);unique" description:"订单ID"` // 评价ID+订单ID
VendorOrderId string `json:"vendor_order_id" orm:"column(vendor_order_id);size(64)" description:"平台订单ID"`
Jxstoreid string `json:"jxstoreid" orm:"column(jxstoreid);size(11);index" description:"京西门店ID"`
Userphone string `json:"userPhone" orm:"column(userphone);size(255);null" description:"评价的用户的联系方式"`
Status int `json:"status" orm:"column(status)" description:"当前评论的状态(0:未解决 1:已解决)"`

View File

@@ -1,7 +1,6 @@
package mtwm
import (
"fmt"
"strings"
"time"
@@ -100,7 +99,7 @@ func (c *PurchaseHandler) RefreshComment(fromTime, toTime time.Time) (err error)
}
vendorOrderID, _ := dao.GetBadCommentOrderId(storeDetail.ID, startTime, endTime, foodNameList)
if vendorOrderID != "" {
orderComment.VendorOrderID = fmt.Sprintf("%s:%s", vendorOrderID, orderComment.VendorOrderID)
orderComment.VendorOrderID2 = vendorOrderID
}
}