- enable elm user urge order.
- delay 4 minutes when got new elm order.
This commit is contained in:
@@ -2,6 +2,7 @@ package controller
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"git.rosy.net.cn/baseapi"
|
||||
"git.rosy.net.cn/baseapi/platformapi/elmapi"
|
||||
@@ -56,7 +57,9 @@ func (o *OrderController) OrderMessage(msg *elmapi.CallbackMsg) (retVal *elmapi.
|
||||
func OnNewOrder(orderID string, userMobile string) {
|
||||
controllers.OnNewOrder(orderID, controllers.ELM_VENDORID, userMobile, 0, nil, func(acceptIt bool) {
|
||||
if acceptIt {
|
||||
api.ElmAPI.ConfirmOrder(orderID)
|
||||
time.AfterFunc(4*time.Minute, func() {
|
||||
api.ElmAPI.ConfirmOrder(orderID)
|
||||
})
|
||||
} else {
|
||||
api.ElmAPI.CancelOrder(orderID, elmapi.CancelOrderTypeOthers, "")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user