- make lastOrderTime and lastOrderSeqID optional
This commit is contained in:
@@ -102,12 +102,10 @@ func unregisterChan(storeID int, chan2Listen chan<- *ServerMsg) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func getPendingOrderList(storeID int, lastOrderTime time.Time, lastOrderSeqID int64) (orderList []*model.GoodsOrderExt, err error) {
|
func getPendingOrderList(storeID int, lastOrderTime time.Time, lastOrderSeqID int64) (orderList []*model.GoodsOrderExt, err error) {
|
||||||
if !jxutils.IsTimeEmpty(lastOrderTime) {
|
if jxutils.IsTimeEmpty(lastOrderTime) || time.Now().Sub(lastOrderTime) > maxGetOrderTimeDuration {
|
||||||
if time.Now().Sub(lastOrderTime) > maxGetOrderTimeDuration {
|
lastOrderTime = time.Now().Add(-maxGetOrderTimeDuration)
|
||||||
lastOrderTime = time.Now().Add(-maxGetOrderTimeDuration)
|
|
||||||
}
|
|
||||||
orderList, err = dao.GetStoreOrderAfterTime(dao.GetDB(), storeID, lastOrderTime, lastOrderSeqID)
|
|
||||||
}
|
}
|
||||||
|
orderList, err = dao.GetStoreOrderAfterTime(dao.GetDB(), storeID, lastOrderTime, lastOrderSeqID)
|
||||||
return orderList, err
|
return orderList, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -157,8 +157,8 @@ func (c *CmsController) GetProductInfoByBarCode() {
|
|||||||
// @Description 得到服务器消息通知
|
// @Description 得到服务器消息通知
|
||||||
// @Param token header string true "认证token"
|
// @Param token header string true "认证token"
|
||||||
// @Param storeID query int true "京西门店ID"
|
// @Param storeID query int true "京西门店ID"
|
||||||
// @Param lastOrderTime query string true "最后订单时间"
|
// @Param lastOrderTime query string false "最后订单时间(缺省为24小时内)"
|
||||||
// @Param lastOrderSeqID query string true "最后订单流水ID"
|
// @Param lastOrderSeqID query string false "最后订单流水ID(缺省为0)"
|
||||||
// @Param waitingSecond query int false "等待时间"
|
// @Param waitingSecond query int false "等待时间"
|
||||||
// @Success 200 {object} controllers.CallResult
|
// @Success 200 {object} controllers.CallResult
|
||||||
// @Failure 200 {object} controllers.CallResult
|
// @Failure 200 {object} controllers.CallResult
|
||||||
|
|||||||
Reference in New Issue
Block a user