up_year.go 502 B

1234567891011121314151617181920
  1. package dao
  2. import (
  3. "context"
  4. "database/sql"
  5. )
  6. const (
  7. _upTagYearSQL = "SELECT tag1, tag2, tag3, tag4, tag5, tag6, total_income FROM up_tag_year WHERE mid = ?"
  8. )
  9. // GetUpYearTag get up year tag income
  10. func (d *Dao) GetUpYearTag(c context.Context, mid int64) (tags []int64, income int64, err error) {
  11. tags = make([]int64, 6)
  12. err = d.db.QueryRow(c, _upTagYearSQL, mid).Scan(&tags[0], &tags[1], &tags[2], &tags[3], &tags[4], &tags[5], &income)
  13. if err == sql.ErrNoRows {
  14. err = nil
  15. }
  16. return
  17. }