Explorar el Código

:art: Get db key values sort by updated

Daniel hace 1 año
padre
commit
6af0432145
Se han modificado 1 ficheros con 4 adiciones y 0 borrados
  1. 4 0
      kernel/model/attribute_view.go

+ 4 - 0
kernel/model/attribute_view.go

@@ -102,6 +102,10 @@ func GetAttributeViewPrimaryKeyValues(avID, keyword string, page, pageSize int)
 		end = len(keyValues.Values)
 	}
 	keyValues.Values = keyValues.Values[start:end]
+
+	sort.Slice(keyValues.Values, func(i, j int) bool {
+		return keyValues.Values[i].Block.Updated > keyValues.Values[j].Block.Updated
+	})
 	return
 }