aa
This commit is contained in:
@@ -1369,3 +1369,30 @@ func GetBrandBalance(db *DaoDB, brandID int) (result int, err error) {
|
||||
err = GetRow(db, &balance, sql, sqlParams)
|
||||
return balance.Balance, err
|
||||
}
|
||||
|
||||
func GetBrandBill(db *DaoDB, brandID int, vendorOrderID string, billType, feeType int) (result []*model.BrandBill, err error) {
|
||||
sql := `
|
||||
SELECT *
|
||||
FROM brand_bill
|
||||
WHERE 1 = 1
|
||||
`
|
||||
sqlParams := []interface{}{}
|
||||
if brandID != 0 {
|
||||
sql += " AND brand_id = ?"
|
||||
sqlParams = append(sqlParams, brandID)
|
||||
}
|
||||
if billType != 0 {
|
||||
sql += " AND bill_type = ?"
|
||||
sqlParams = append(sqlParams, billType)
|
||||
}
|
||||
if feeType != 0 {
|
||||
sql += " AND fee_type = ?"
|
||||
sqlParams = append(sqlParams, feeType)
|
||||
}
|
||||
if vendorOrderID != "" {
|
||||
sql += " AND vendor_order_id = ?"
|
||||
sqlParams = append(sqlParams, vendorOrderID)
|
||||
}
|
||||
err = GetRows(db, &result, sql, sqlParams)
|
||||
return result, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user