- switch jd bad comment to new jx.
This commit is contained in:
@@ -238,7 +238,7 @@ func PushJDBadCommentToWeiXin(comment *model.JxBadComments) (err error) {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
storeID := int(utils.Str2Int64(comment.Jxstoreid))
|
storeID := int(utils.Str2Int64(comment.Jxstoreid))
|
||||||
return SendMsgToStore(0, WX_BAD_COMMENT_PUSH_TEMPLATE_ID, fmt.Sprintf("%s%d", WX_TO_SHOW_COMMENTS_DETAIL_URL, storeID), data)
|
return SendMsgToStore(storeID, WX_BAD_COMMENT_PUSH_TEMPLATE_ID, fmt.Sprintf("%s%d", WX_TO_SHOW_COMMENTS_DETAIL_URL, storeID), data)
|
||||||
}
|
}
|
||||||
|
|
||||||
func FormatDeliveryTime(order *model.GoodsOrder) string {
|
func FormatDeliveryTime(order *model.GoodsOrder) string {
|
||||||
|
|||||||
@@ -54,5 +54,5 @@ type JxBadComments struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (*JxBadComments) TableName() string {
|
func (*JxBadComments) TableName() string {
|
||||||
return "jx_bad_comments2"
|
return "jx_bad_comments"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ func (c *PurchaseHandler) onOrderMsg(msg *jdapi.CallbackOrderMsg) (retVal *jdapi
|
|||||||
} else {
|
} else {
|
||||||
status := c.callbackMsg2Status(msg)
|
status := c.callbackMsg2Status(msg)
|
||||||
if msg.StatusID == jdapi.OrderStatusAddComment || msg.StatusID == jdapi.OrderStatusModifyComment {
|
if msg.StatusID == jdapi.OrderStatusAddComment || msg.StatusID == jdapi.OrderStatusModifyComment {
|
||||||
if globals.ReallyCallPlatformAPI {
|
if false { //globals.ReallyCallPlatformAPI {
|
||||||
freshfood.FreshFoodAPI.JDOrderComment(msg)
|
freshfood.FreshFoodAPI.JDOrderComment(msg)
|
||||||
}
|
}
|
||||||
if err := c.onOrderComment(msg); err != nil {
|
if err := c.onOrderComment(msg); err != nil {
|
||||||
|
|||||||
@@ -138,9 +138,9 @@ func (c *PurchaseHandler) onOrderComment(msg *jdapi.CallbackOrderMsg) (err error
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *PurchaseHandler) replyOrderComment(intOrderID int64, jdStoreNo string, score int) (err error) {
|
func (c *PurchaseHandler) replyOrderComment(intOrderID int64, jdStoreNo string, score int) (err error) {
|
||||||
if score == 2 {
|
if score <= 2 {
|
||||||
score = 1
|
score = 1
|
||||||
} else if score == 5 {
|
} else if score >= 5 {
|
||||||
score = 4
|
score = 4
|
||||||
}
|
}
|
||||||
config := replyConfig[score]
|
config := replyConfig[score]
|
||||||
@@ -148,7 +148,7 @@ func (c *PurchaseHandler) replyOrderComment(intOrderID int64, jdStoreNo string,
|
|||||||
content := config.comments[rand.Intn(len(config.comments))]
|
content := config.comments[rand.Intn(len(config.comments))]
|
||||||
time.AfterFunc(time.Duration(delaySeconds)*time.Second, func() {
|
time.AfterFunc(time.Duration(delaySeconds)*time.Second, func() {
|
||||||
utils.CallFuncLogError(func() error {
|
utils.CallFuncLogError(func() error {
|
||||||
if false { //globals.ReallyCallPlatformAPI {
|
if globals.ReallyCallPlatformAPI {
|
||||||
return api.JdAPI.OrgReplyComment(intOrderID, jdStoreNo, content, utils.GetAPIOperator(""))
|
return api.JdAPI.OrgReplyComment(intOrderID, jdStoreNo, content, utils.GetAPIOperator(""))
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
Reference in New Issue
Block a user