- 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 {
lastOrderTime = time.Now().Add(-maxGetOrderTimeDuration)
}
orderList, err = dao.GetStoreOrderAfterTime(dao.GetDB(), storeID, lastOrderTime, lastOrderSeqID)
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
}