links.go 238 B

123456789101112131415
  1. package service
  2. import (
  3. "cc-officialweb/models"
  4. "cc-officialweb/utils"
  5. )
  6. func GetAllLinks() (links []models.Link) {
  7. tx := utils.DB.Order("sort desc").Find(&links)
  8. if tx.RowsAffected > 0 {
  9. return links
  10. } else {
  11. return nil
  12. }
  13. }