• 请不要在回答技术问题时复制粘贴 AI 生成的内容
chenxx
V2EX  ›  程序员

评论的排序是怎么做

  •  
  •   chenxx · Oct 3, 2016 · 3262 views
    This topic created in 3700 days ago, the information mentioned may be changed or developed.

    请教各位,评论的排序是如何做的,我现在的网站的评论,赞和踩都是用 redis 来做的,我想用赞越多的排在越前面。

    4 replies  •  2016-10-07 10:45:49 +08:00
    Elven
    Elven
    Oct 4, 2016 via Android
    1
    _(:з」∠)_一个排序就完了啊
    reus
    reus
    Oct 4, 2016
    2
    你用数据库存就没这么多事情了。
    Jacklee
    Jacklee
    Oct 5, 2016
    3
    既然是 Redis 不是有对应的数据类型么 Sort Set 有序集合,赞作为权重排个序
    mingyun
    mingyun
    Oct 7, 2016
    4
    zset zadd commentid favs zrevrangebyscore
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2364 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 52ms · UTC 10:43 · PVG 18:43 · LAX 02:43 · JFK 05:43
    ♥ Do have faith in what you're doing.