This commit is contained in:
邹宗楠
2024-07-18 14:27:48 +08:00
parent df043e1df0
commit 6b5051c13c
3 changed files with 76 additions and 13 deletions

View File

@@ -91,21 +91,20 @@ func (c *PurchaseHandler) RefreshComment(fromTime, toTime time.Time) (err error)
}
}
if len(mtwmComment.CommentOrderDetail) > 0 {
foodNameList := make([]string, 0, len(mtwmComment.CommentOrderDetail))
for _, fn := range mtwmComment.CommentOrderDetail {
if len(fn.FoodName)-strings.LastIndex(fn.FoodName, "") > 3 {
foodNameList = append(foodNameList, fn.FoodName)
} else {
foodNameList = append(foodNameList, fn.FoodName[0:strings.LastIndex(fn.FoodName, "")])
}
}
foodNameList := make([]string, 0, 0)
for _, fn := range mtwmComment.PraiseRetailList {
foodNameList = append(foodNameList, fn.Name)
}
for _, fn := range mtwmComment.CriticRetailList {
foodNameList = append(foodNameList, fn.Name)
}
if len(foodNameList) > 0 {
vendorOrderID, _ := dao.GetBadCommentOrderId(storeDetail.ID, startTime, endTime, foodNameList)
if vendorOrderID != "" {
orderComment.VendorOrderID2 = vendorOrderID
}
}
orderCommentList = append(orderCommentList, orderComment)
}
}