1
This commit is contained in:
@@ -80,6 +80,7 @@ func (c *OrderManager) OnOrderComments(orderCommentList []*model.OrderComment) (
|
|||||||
if err == nil || dao.IsNoRowsError(err) {
|
if err == nil || dao.IsNoRowsError(err) {
|
||||||
isNewComment := false
|
isNewComment := false
|
||||||
if dao.IsNoRowsError(err) {
|
if dao.IsNoRowsError(err) {
|
||||||
|
globals.SugarLogger.Debugf("========dao.IsNoRowsError= :%s", utils.Format4Output(orderComment, false))
|
||||||
err = nil
|
err = nil
|
||||||
isNewComment = true
|
isNewComment = true
|
||||||
if orderComment.IsReplied == 0 && time.Now().Sub(orderComment.CommentCreatedAt) < time.Duration(orderComment.ModifyDuration)*time.Hour {
|
if orderComment.IsReplied == 0 && time.Now().Sub(orderComment.CommentCreatedAt) < time.Duration(orderComment.ModifyDuration)*time.Hour {
|
||||||
@@ -157,6 +158,9 @@ func (c *OrderManager) OnOrderComments(orderCommentList []*model.OrderComment) (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
globals.SugarLogger.Debugf("========comment2= :%s", utils.Format4Output(comment2, false))
|
||||||
|
globals.SugarLogger.Debugf("========isNewComment= :%s", utils.Format4Output(isNewComment, false))
|
||||||
|
|
||||||
if err == nil {
|
if err == nil {
|
||||||
if isNewComment {
|
if isNewComment {
|
||||||
err = dao.CreateEntity(db, comment2)
|
err = dao.CreateEntity(db, comment2)
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ func (c *PurchaseHandler) StartRefreshComment() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *PurchaseHandler) refreshCommentOnce() {
|
func (c *PurchaseHandler) refreshCommentOnce() {
|
||||||
|
globals.SugarLogger.Debugf("%s", utils.Format4Output(time.Now(), false))
|
||||||
c.RefreshComment(time.Now().Add(-RefreshCommentTime), time.Now())
|
c.RefreshComment(time.Now().Add(-RefreshCommentTime), time.Now())
|
||||||
utils.AfterFuncWithRecover(RefreshCommentTimeInterval, func() {
|
utils.AfterFuncWithRecover(RefreshCommentTimeInterval, func() {
|
||||||
c.refreshCommentOnce()
|
c.refreshCommentOnce()
|
||||||
@@ -55,6 +56,7 @@ func (c *PurchaseHandler) RefreshComment(fromTime, toTime time.Time) (err error)
|
|||||||
storeID := batchItemList[0].(int)
|
storeID := batchItemList[0].(int)
|
||||||
storeDetail, _ := dao.GetStoreDetail(dao.GetDB(), storeID, model.VendorIDMTWM, "")
|
storeDetail, _ := dao.GetStoreDetail(dao.GetDB(), storeID, model.VendorIDMTWM, "")
|
||||||
commentList, err2 := getAPI(storeDetail.VendorOrgCode, storeID, storeDetail.VendorStoreID).CommentQuery(storeDetail.VendorStoreID, startDateStr, endDateStr, 0, 0, mtwmapi.CommentReplyStatusNotReplied)
|
commentList, err2 := getAPI(storeDetail.VendorOrgCode, storeID, storeDetail.VendorStoreID).CommentQuery(storeDetail.VendorStoreID, startDateStr, endDateStr, 0, 0, mtwmapi.CommentReplyStatusNotReplied)
|
||||||
|
globals.SugarLogger.Debugf("========commentList= :%s", utils.Format4Output(commentList, false))
|
||||||
var orderCommentList []*model.OrderComment
|
var orderCommentList []*model.OrderComment
|
||||||
if err = err2; err != nil {
|
if err = err2; err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|||||||
Reference in New Issue
Block a user