parent
fb399ac973
commit
8b996803c8
5 changed files with 30 additions and 5 deletions
|
@ -40,6 +40,15 @@ func (db *pgDB) IncDownloads(ID string) error {
|
|||
return err
|
||||
}
|
||||
|
||||
func (db *pgDB) GetDownloadCounter(ID string) (int, error) {
|
||||
var num int
|
||||
err := db.sql.Model(&Visit{}).
|
||||
Column("downloads").
|
||||
Where("book_id = ?", ID).
|
||||
Select(&num)
|
||||
return num, err
|
||||
}
|
||||
|
||||
func (db *pgDB) GetFrontPage() FrontPage {
|
||||
return db.frontPage
|
||||
}
|
||||
|
|
Reference in a new issue