1
This commit is contained in:
@@ -153,8 +153,10 @@ func (c *PurchaseHandler) ReplyOrderComment(ctx *jxcontext.Context, vendorOrgCod
|
||||
|
||||
func GetMtwmCommentList4ShanGou(key string, appOrgCode string, startTime, endTime string) error {
|
||||
var (
|
||||
db = dao.GetDB()
|
||||
now = time.Now()
|
||||
db = dao.GetDB()
|
||||
now = time.Now()
|
||||
errs = make([]string, 0, 0)
|
||||
pageNum = 1
|
||||
)
|
||||
end, _ := utils.TryStr2Time(endTime)
|
||||
if end.Year() == now.Year() && end.Month() == now.Month() && end.Day() == now.Day() {
|
||||
@@ -171,7 +173,7 @@ func GetMtwmCommentList4ShanGou(key string, appOrgCode string, startTime, endTim
|
||||
param := map[string]interface{}{
|
||||
"wmPoiId": -1,
|
||||
"appType": 3,
|
||||
"pageNum": 1,
|
||||
"pageNum": pageNum,
|
||||
"rate": 0,
|
||||
"reply": -1,
|
||||
"context": -1,
|
||||
@@ -179,20 +181,30 @@ func GetMtwmCommentList4ShanGou(key string, appOrgCode string, startTime, endTim
|
||||
"endDate": endTime,
|
||||
"timeType": 4,
|
||||
}
|
||||
for {
|
||||
commentList, err := getAPI(appOrgCode, 0, "").GetComment4ShanGou(param, true, configList[0].Value)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if len(commentList) == model.NO {
|
||||
return fmt.Errorf("查询参数暂未获取到数据")
|
||||
}
|
||||
// 差评订单数据
|
||||
orderCommentList := CommentListData(db, commentList, startTime, endTime)
|
||||
if len(orderCommentList) > 0 {
|
||||
err2 := partner.CurOrderManager.OnOrderComments(orderCommentList)
|
||||
if err2 != nil {
|
||||
errs = append(errs, err2.Error())
|
||||
}
|
||||
}
|
||||
if len(commentList) >= 10 {
|
||||
pageNum += 1
|
||||
} else {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
commentList, err := getAPI(appOrgCode, 0, "").GetComment4ShanGou(param, true, configList[0].Value)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if len(commentList) == model.NO {
|
||||
return fmt.Errorf("查询参数暂未获取到数据")
|
||||
}
|
||||
// 差评订单数据
|
||||
orderCommentList := CommentListData(db, commentList, startTime, endTime)
|
||||
if len(orderCommentList) > 0 {
|
||||
return partner.CurOrderManager.OnOrderComments(orderCommentList)
|
||||
}
|
||||
return nil
|
||||
return fmt.Errorf("%s", strings.Join(errs, ","))
|
||||
}
|
||||
|
||||
func CommentListData(db *dao.DaoDB, skuList []*mtwmapi.CommentsList, startTime, endTime string) []*model.OrderComment {
|
||||
|
||||
Reference in New Issue
Block a user