订单查询

This commit is contained in:
苏尹岚
2020-05-19 11:11:34 +08:00
parent 5232001cd0
commit 49403d559d

View File

@@ -976,7 +976,7 @@ type GetOrderSimpleInfoResult struct {
func GetOrderSimpleInfo(ctx *jxcontext.Context, vendorOrderID string) (getOrderSimpleInfoResult *GetOrderSimpleInfoResult, err error) { func GetOrderSimpleInfo(ctx *jxcontext.Context, vendorOrderID string) (getOrderSimpleInfoResult *GetOrderSimpleInfoResult, err error) {
db := dao.GetDB() db := dao.GetDB()
sql := ` sql := `
SELECT a.vendor_order_id, a.status, b.waybill_vendor_id, b.courier_name, b.courier_mobile, b.tel1, b.market_man_phone SELECT a.vendor_order_id, a.status, c.waybill_vendor_id, c.courier_name, c.courier_mobile, b.tel1, b.market_man_phone
FROM goods_order a FROM goods_order a
JOIN store b ON IF(a.store_id <> '', a.store_id, a.jx_store_id) = b.id JOIN store b ON IF(a.store_id <> '', a.store_id, a.jx_store_id) = b.id
LEFT JOIN waybill c ON c.vendor_order_id = a.vendor_order_id LEFT JOIN waybill c ON c.vendor_order_id = a.vendor_order_id
@@ -984,6 +984,8 @@ func GetOrderSimpleInfo(ctx *jxcontext.Context, vendorOrderID string) (getOrderS
` `
sqlParams := []interface{}{vendorOrderID} sqlParams := []interface{}{vendorOrderID}
err = dao.GetRow(db, &getOrderSimpleInfoResult, sql, sqlParams) err = dao.GetRow(db, &getOrderSimpleInfoResult, sql, sqlParams)
if getOrderSimpleInfoResult == nil {
return getOrderSimpleInfoResult, fmt.Errorf("未查询到该订单的信息!订单号:[%v]", vendorOrderID)
}
return getOrderSimpleInfoResult, err return getOrderSimpleInfoResult, err
} }