aboutsummaryrefslogtreecommitdiffstats
path: root/models/repo.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/repo.go')
-rw-r--r--models/repo.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/models/repo.go b/models/repo.go
index b5567bf683..4ee99dab7c 100644
--- a/models/repo.go
+++ b/models/repo.go
@@ -1464,7 +1464,8 @@ func GetRepositoryByID(id int64) (*Repository, error) {
// GetRepositories returns a list of repositories of given user.
func GetRepositories(uid int64, private bool) ([]*Repository, error) {
repos := make([]*Repository, 0, 10)
- sess := x.Desc("updated")
+ sess := x.Desc("updated_unix")
+
if !private {
sess.Where("is_private=?", false)
}
@@ -1475,7 +1476,7 @@ func GetRepositories(uid int64, private bool) ([]*Repository, error) {
// GetRecentUpdatedRepositories returns the list of repositories that are recently updated.
func GetRecentUpdatedRepositories(page int) (repos []*Repository, err error) {
return repos, x.Limit(setting.ExplorePagingNum, (page-1)*setting.ExplorePagingNum).
- Where("is_private=?", false).Limit(setting.ExplorePagingNum).Desc("updated").Find(&repos)
+ Where("is_private=?", false).Limit(setting.ExplorePagingNum).Desc("updated_unix").Find(&repos)
}
func getRepositoryCount(e Engine, u *User) (int64, error) {