以整张 ranking 排名表为例,要计算出当前用户超过整表总人数的占比: // 示例代码:$total=$ranking->count();($total - $index) / $total * 100 $total 变量为当前ranking表总人数$index 变量为当前用户的排名