This commit is contained in:
邹宗楠
2023-06-01 12:47:35 +08:00
parent f38c6bcc4b
commit 2433cbd9f3
3 changed files with 26 additions and 23 deletions

View File

@@ -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