- make lastOrderTime and lastOrderSeqID optional

This commit is contained in:
gazebo
2019-03-06 16:36:44 +08:00
parent 3771f36617
commit d1237af716
2 changed files with 5 additions and 7 deletions

View File

@@ -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) {
if !jxutils.IsTimeEmpty(lastOrderTime) {
if time.Now().Sub(lastOrderTime) > maxGetOrderTimeDuration {
if jxutils.IsTimeEmpty(lastOrderTime) || time.Now().Sub(lastOrderTime) > maxGetOrderTimeDuration {
lastOrderTime = time.Now().Add(-maxGetOrderTimeDuration)
}
orderList, err = dao.GetStoreOrderAfterTime(dao.GetDB(), storeID, lastOrderTime, lastOrderSeqID)
}
return orderList, err
}

View File

@@ -157,8 +157,8 @@ func (c *CmsController) GetProductInfoByBarCode() {
// @Description 得到服务器消息通知
// @Param token header string true "认证token"
// @Param storeID query int true "京西门店ID"
// @Param lastOrderTime query string true "最后订单时间"
// @Param lastOrderSeqID query string true "最后订单流水ID"
// @Param lastOrderTime query string false "最后订单时间缺省为24小时内"
// @Param lastOrderSeqID query string false "最后订单流水ID缺省为0"
// @Param waitingSecond query int false "等待时间"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult