- 调整QueryOrderWaybillFeeInfo
This commit is contained in:
@@ -157,19 +157,25 @@ func (c *OrderManager) GetOrderInfo(ctx *jxcontext.Context, vendorOrderID string
|
||||
return nil, err
|
||||
}
|
||||
|
||||
func (c *OrderManager) GetOrderWaybillInfo(ctx *jxcontext.Context, vendorOrderID string, vendorID int) (bills []*model.Waybill, err error) {
|
||||
func (c *OrderManager) GetOrderWaybillInfo(ctx *jxcontext.Context, vendorOrderID string, vendorID int, isNotEnded bool) (bills []*model.Waybill, err error) {
|
||||
globals.SugarLogger.Debugf("GetOrderWaybillInfo orderID:%s", vendorOrderID)
|
||||
db := orm.NewOrm()
|
||||
_, err = db.Raw(`
|
||||
db := dao.GetDB()
|
||||
sql := `
|
||||
SELECT t1.*
|
||||
FROM waybill t1
|
||||
WHERE t1.vendor_order_id = ? AND order_vendor_id = ?
|
||||
`, vendorOrderID, vendorID).QueryRows(&bills)
|
||||
if err == nil {
|
||||
return bills, nil
|
||||
`
|
||||
sqlParams := []interface{}{
|
||||
vendorOrderID,
|
||||
vendorID,
|
||||
}
|
||||
if isNotEnded {
|
||||
sql += " AND t1.status < ?"
|
||||
sqlParams = append(sqlParams, model.OrderStatusEndBegin)
|
||||
}
|
||||
err = dao.GetRows(db, &bills, sql, sqlParams...)
|
||||
globals.SugarLogger.Infof("GetOrderWaybillInfo orderID:%s failed with error:%v", vendorOrderID, err)
|
||||
return nil, err
|
||||
return bills, err
|
||||
}
|
||||
|
||||
func (c *OrderManager) ExportMTWaybills(ctx *jxcontext.Context, fromDateStr, toDateStr string) (excelContent []byte, err error) {
|
||||
|
||||
Reference in New Issue
Block a user