mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-26 09:34:57 +08:00
feat(source link): record downloads for redirected source link
This commit is contained in:
@@ -39,3 +39,9 @@ func GetSourceLinkByID(id interface{}) (*SourceLink, error) {
|
||||
|
||||
return link, result.Error
|
||||
}
|
||||
|
||||
// Viewed 增加访问次数
|
||||
func (s *SourceLink) Downloaded() {
|
||||
s.Downloads++
|
||||
DB.Model(s).UpdateColumn("downloads", gorm.Expr("downloads + ?", 1))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user