投诉骑手
This commit is contained in:
@@ -1027,3 +1027,23 @@ func LoadPendingOrders(db *DaoDB, orderCreatedAfter time.Time, beforStatus int)
|
||||
err = GetRows(db, &orderList, sql, sqlParams...)
|
||||
return orderList, err
|
||||
}
|
||||
|
||||
func GetWayBillByOrderID(db *DaoDB, orderStatus, waybillVendorID int, vendorOrderID string) (wayBillList []*model.Waybill, err error) {
|
||||
sql := `
|
||||
SELECT b.*
|
||||
FROM goods_order a
|
||||
LEFT JOIN waybill b ON IF(a.waybill_vendor_id = -1,a.vendor_order_id,a.vendor_waybill_id) = b.vendor_waybill_id
|
||||
WHERE a.vendor_order_id = ?
|
||||
`
|
||||
sqlParams := []interface{}{vendorOrderID}
|
||||
if orderStatus > 0 {
|
||||
sql += ` AND a.status = ?`
|
||||
sqlParams = append(sqlParams, orderStatus)
|
||||
}
|
||||
if waybillVendorID > 0 {
|
||||
sql += ` AND b.waybill_vendor_id = ?`
|
||||
sqlParams = append(sqlParams, waybillVendorID)
|
||||
}
|
||||
err = GetRows(db, &wayBillList, sql, sqlParams...)
|
||||
return wayBillList, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user