1
This commit is contained in:
@@ -1291,10 +1291,20 @@ func GetWayBillByOrderID(db *DaoDB, orderStatus, vendorID, waybillVendorID int,
|
||||
return wayBillList, err
|
||||
}
|
||||
|
||||
func GetComplaintList(db *DaoDB, orderId string) ([]*model.Waybill, error) {
|
||||
sql := ` SELECT * FROM waybill WHERE vendor_order_id = ? AND courier_name <> '' AND courier_mobile <> '' `
|
||||
func GetComplaintList(db *DaoDB, orderId string, vendorWaybillId string) ([]*model.Waybill, error) {
|
||||
sql := ` SELECT * FROM waybill WHERE vendor_order_id = ? `
|
||||
var param []interface{}
|
||||
param = append(param, orderId)
|
||||
if vendorWaybillId != "" {
|
||||
sql += ` AND vendor_waybill_id = ? `
|
||||
param = append(param, vendorWaybillId)
|
||||
}
|
||||
|
||||
sql += ` AND waybill_vendor_id IN (?,?,?) AND courier_name <> '' AND courier_mobile <> '' ORDER BY waybill_created_at `
|
||||
param = append(param, model.VendorIDFengNiao, model.VendorIDDada, model.VendorIDMTPS)
|
||||
|
||||
var data []*model.Waybill
|
||||
if err := GetRows(db, &data, sql, []interface{}{orderId}); err != nil {
|
||||
if err := GetRows(db, &data, sql, param...); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return data, nil
|
||||
|
||||
Reference in New Issue
Block a user