美团外卖评价正确设置TagList
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
package mtwm
|
package mtwm
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"git.rosy.net.cn/baseapi/platformapi/mtwmapi"
|
"git.rosy.net.cn/baseapi/platformapi/mtwmapi"
|
||||||
@@ -35,6 +36,13 @@ func (c *PurchaseHandler) refreshCommentOnce() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func formalizeTagList(mtwmTagList string) (outTagList string) {
|
||||||
|
if mtwmTagList != "" {
|
||||||
|
outTagList = string(utils.Format4Output(strings.Split(mtwmTagList, ","), true))
|
||||||
|
}
|
||||||
|
return outTagList
|
||||||
|
}
|
||||||
|
|
||||||
func (c *PurchaseHandler) RefreshComment(fromTime, toTime time.Time) (err error) {
|
func (c *PurchaseHandler) RefreshComment(fromTime, toTime time.Time) (err error) {
|
||||||
storeMapList, err2 := dao.GetStoresMapList(dao.GetDB(), []int{model.VendorIDMTWM}, nil, model.StoreStatusAll, model.StoreIsSyncYes, "")
|
storeMapList, err2 := dao.GetStoresMapList(dao.GetDB(), []int{model.VendorIDMTWM}, nil, model.StoreStatusAll, model.StoreIsSyncYes, "")
|
||||||
if err = err2; err != nil {
|
if err = err2; err != nil {
|
||||||
@@ -59,7 +67,7 @@ func (c *PurchaseHandler) RefreshComment(fromTime, toTime time.Time) (err error)
|
|||||||
VendorID: model.VendorIDMTWM,
|
VendorID: model.VendorIDMTWM,
|
||||||
UserCommentID: utils.Int64ToStr(mtwmComment.CommentID),
|
UserCommentID: utils.Int64ToStr(mtwmComment.CommentID),
|
||||||
VendorStoreID: storeMap.VendorStoreID,
|
VendorStoreID: storeMap.VendorStoreID,
|
||||||
TagList: mtwmComment.CommentLables,
|
TagList: formalizeTagList(mtwmComment.CommentLables),
|
||||||
Score: int8(mtwmComment.FoodCommentScore),
|
Score: int8(mtwmComment.FoodCommentScore),
|
||||||
ModifyDuration: BAD_COMMENTS_MAX_MODIFY_TIME,
|
ModifyDuration: BAD_COMMENTS_MAX_MODIFY_TIME,
|
||||||
OriginalMsg: string(utils.MustMarshal(mtwmComment)),
|
OriginalMsg: string(utils.MustMarshal(mtwmComment)),
|
||||||
|
|||||||
Reference in New Issue
Block a user