- bug fix.

This commit is contained in:
gazebo
2018-07-19 12:18:36 +08:00
parent bbed659c04
commit 3098740dce
6 changed files with 104 additions and 74 deletions

View File

@@ -76,7 +76,7 @@ func (c *OrderController) saveOrder(order *model.GoodsOrder, isAdjust bool, db o
c.updateOrderOtherInfo(order, db)
db.Begin()
// globals.SugarLogger.Debugf("new order:%v", order)
// order.WaybillVendorID = model.VendorIDUnknown
order.WaybillVendorID = model.VendorIDUnknown
order.OrderFinishedAt = utils.DefaultTimeValue
order.ID = 0
created, _, err2 := db.ReadOrCreate(order, "VendorOrderID", "VendorID")
@@ -235,6 +235,10 @@ func (c *OrderController) UpdateWaybillVendorID(bill *model.Waybill) (err error)
params := orm.Params{
"waybill_vendor_id": bill.WaybillVendorID,
}
// 如果运单被取消,则要保持在已拣货状态
if bill.WaybillVendorID == model.VendorIDUnknown {
params["status"] = model.OrderStatusFinishedPickup
}
utils.CallFuncLogError(func() error {
_, err = db.QueryTable("goods_order").Filter("vendor_order_id", bill.VendorOrderID).Filter("vendor_id", bill.OrderVendorID).Update(params)
return err