This commit is contained in:
gazebo
2018-08-24 15:51:17 +08:00
parent e2c5e467fc
commit 538c2dddd1

View File

@@ -126,6 +126,7 @@ func (c *OrderManager) GetOrderSkuInfo(vendorOrderID string, vendorID int) (skus
func (c *OrderManager) GetOrderInfo(vendorOrderID string, vendorID int) (order *model.GoodsOrderExt, err error) {
globals.SugarLogger.Debugf("GetOrderInfo orderID:%s", vendorOrderID)
db := orm.NewOrm()
order = &model.GoodsOrderExt{}
err = db.Raw(`
SELECT t1.*, t2.status waybill_status, t2.courier_name, t2.courier_mobile
FROM goods_order t1
@@ -142,7 +143,7 @@ func (c *OrderManager) GetOrderInfo(vendorOrderID string, vendorID int) (order *
return nil, err
}
func (c *OrderManager) GetOrderWaybillInfo(vendorOrderID string, vendorID int) (bills *[]model.Waybill, err error) {
func (c *OrderManager) GetOrderWaybillInfo(vendorOrderID string, vendorID int) (bills []*model.Waybill, err error) {
globals.SugarLogger.Debugf("GetOrderWaybillInfo orderID:%s", vendorOrderID)
db := orm.NewOrm()
num, err := db.Raw(`
@@ -150,7 +151,7 @@ func (c *OrderManager) GetOrderWaybillInfo(vendorOrderID string, vendorID int) (
FROM waybill t1
WHERE t1.vendor_order_id = ? AND order_vendor_id = ?
`, vendorOrderID, vendorID).QueryRows(&bills)
if err == nil && num > 0 {
if err == nil {
return bills, nil
}
if num == 0 {