投诉骑手
This commit is contained in:
@@ -1032,7 +1032,7 @@ func GetWayBillByOrderID(db *DaoDB, orderStatus, vendorID, waybillVendorID int,
|
||||
sql := `
|
||||
SELECT b.*
|
||||
FROM goods_order a
|
||||
JOIN waybill b ON IF(a.waybill_vendor_id = -1,a.vendor_order_id,a.vendor_waybill_id) = b.vendor_waybill_id AND b.vendor_id = a.vendor_id
|
||||
JOIN waybill b ON IF(a.waybill_vendor_id = -1,a.vendor_order_id,a.vendor_waybill_id) = b.vendor_waybill_id AND b.order_vendor_id = a.vendor_id
|
||||
WHERE a.vendor_order_id = ?
|
||||
AND a.vendor_id = ?
|
||||
`
|
||||
@@ -1051,3 +1051,52 @@ func GetWayBillByOrderID(db *DaoDB, orderStatus, vendorID, waybillVendorID int,
|
||||
err = GetRows(db, &wayBillList, sql, sqlParams...)
|
||||
return wayBillList, err
|
||||
}
|
||||
|
||||
func GetOrdersSupplement(db *DaoDB, storIDs, vendorIDs []int, vendorOrderID string, fromTime, toTime time.Time, status, stype, offset, pageSize int) (orderSupplementFee []*model.OrderSupplementFee, totalCount int, err error) {
|
||||
sql := `
|
||||
SELECT SQL_CALC_FOUND_ROWS *
|
||||
FROM order_supplement_fee
|
||||
WHERE 1=1
|
||||
AND deleted_at = ?
|
||||
`
|
||||
sqlParams := []interface{}{
|
||||
utils.DefaultTimeValue,
|
||||
}
|
||||
if !utils.IsTimeZero(fromTime) {
|
||||
sql += " AND supplement_time >= ?"
|
||||
sqlParams = append(sqlParams, fromTime)
|
||||
}
|
||||
if !utils.IsTimeZero(toTime) {
|
||||
sql += " AND supplement_time <= ?"
|
||||
sqlParams = append(sqlParams, toTime)
|
||||
}
|
||||
if len(storIDs) > 0 {
|
||||
sql += " AND store_id IN (" + GenQuestionMarks(len(storIDs)) + ")"
|
||||
sqlParams = append(sqlParams, storIDs)
|
||||
}
|
||||
if len(vendorIDs) > 0 {
|
||||
sql += " AND store_id IN (" + GenQuestionMarks(len(vendorIDs)) + ")"
|
||||
sqlParams = append(sqlParams, vendorIDs)
|
||||
}
|
||||
if vendorOrderID != "" {
|
||||
sql += " AND vendor_order_id = ?"
|
||||
sqlParams = append(sqlParams, vendorOrderID)
|
||||
}
|
||||
if status >= 0 {
|
||||
sql += " AND status = ?"
|
||||
sqlParams = append(sqlParams, status)
|
||||
}
|
||||
if stype >= 0 {
|
||||
sql += " AND type = ?"
|
||||
sqlParams = append(sqlParams, stype)
|
||||
}
|
||||
sql += `
|
||||
LIMIT ? OFFSET ?`
|
||||
sqlParams = append(sqlParams, pageSize, offset)
|
||||
Begin(db)
|
||||
defer Commit(db)
|
||||
if err = GetRows(db, &orderSupplementFee, sql, sqlParams...); err == nil {
|
||||
totalCount = GetLastTotalRowCount(db)
|
||||
}
|
||||
return orderSupplementFee, totalCount, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user