自动关注

This commit is contained in:
苏尹岚
2019-12-31 13:31:29 +08:00
parent 2c5d4801b0
commit 0f2058de84
11 changed files with 212 additions and 42 deletions

View File

@@ -1052,7 +1052,7 @@ func GetWayBillByOrderID(db *DaoDB, orderStatus, vendorID, waybillVendorID int,
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) {
func GetOrdersSupplement(db *DaoDB, storIDs, vendorIDs []int, vendorOrderID string, fromTime, toTime time.Time, status, stype, IsReverse, offset, pageSize int) (orderSupplementFee []*model.OrderSupplementFee, totalCount int, err error) {
sql := `
SELECT SQL_CALC_FOUND_ROWS *
FROM order_supplement_fee
@@ -1075,7 +1075,7 @@ func GetOrdersSupplement(db *DaoDB, storIDs, vendorIDs []int, vendorOrderID stri
sqlParams = append(sqlParams, storIDs)
}
if len(vendorIDs) > 0 {
sql += " AND store_id IN (" + GenQuestionMarks(len(vendorIDs)) + ")"
sql += " AND vendor_id IN (" + GenQuestionMarks(len(vendorIDs)) + ")"
sqlParams = append(sqlParams, vendorIDs)
}
if vendorOrderID != "" {
@@ -1090,6 +1090,11 @@ func GetOrdersSupplement(db *DaoDB, storIDs, vendorIDs []int, vendorOrderID stri
sql += " AND type = ?"
sqlParams = append(sqlParams, stype)
}
if IsReverse == -1 {
sql += " AND link_id = 0"
} else if IsReverse == 1 {
sql += " AND link_id <> 0"
}
sql += `
LIMIT ? OFFSET ?`
sqlParams = append(sqlParams, pageSize, offset)