- fixed load pending orders.
This commit is contained in:
@@ -22,6 +22,7 @@ func NewWaybillManager() *WaybillController {
|
||||
func (w *WaybillController) LoadPendingWaybills() []*model.Waybill {
|
||||
db := orm.NewOrm()
|
||||
var bills []*model.Waybill
|
||||
tillTime := time.Now().Add(-pendingOrderGapMax)
|
||||
_, err := db.Raw(`
|
||||
SELECT t1.*
|
||||
FROM waybill t1
|
||||
@@ -29,11 +30,9 @@ func (w *WaybillController) LoadPendingWaybills() []*model.Waybill {
|
||||
AND t2.vendor_id = t1.order_vendor_id
|
||||
AND t2.order_created_at >= ?
|
||||
AND t2.status < ?
|
||||
WHERE waybill_created_at >= ?
|
||||
WHERE t1.waybill_created_at >= ?
|
||||
AND t1.status < ?
|
||||
ORDER by waybill_created_at
|
||||
`, time.Now().Add(-pendingOrderGapMax), model.WaybillStatusEndBegin,
|
||||
time.Now().Add(-pendingOrderGapMax), model.WaybillStatusEndBegin).QueryRows(&bills)
|
||||
`, tillTime, model.OrderStatusEndBegin, tillTime, model.WaybillStatusEndBegin).QueryRows(&bills)
|
||||
if err != nil {
|
||||
globals.SugarLogger.Warnf("LoadPendingWaybills load pending waybills error:%v", err)
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user