restore old sorting
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-03-28 12:48:04 -07:00
parent 51a0954b27
commit 8d1db5c15e
2 changed files with 7 additions and 4 deletions

View File

@@ -24,7 +24,7 @@ func NewRequestHandlerSet(version string, db *gorm.DB) *RequestHandlerSet {
func (r *RequestHandlerSet) indexHandler(c echo.Context) error {
last24h := time.Now().Add(time.Second * 86400 * -1)
var fpi []HNFrontPage
r.db.Where("disappeared is not ? and disappeared > ?", time.Time{}, last24h).Select("*, ( strftime('%s',disappeared) - strftime('%s',appeared)) as hangtime").Order("hangtime asc").Find(&fpi)
r.db.Where("disappeared is not ? and disappeared > ?", time.Time{}, last24h).Order("disappeared desc").Find(&fpi)
type fprow struct {
Duration string