<?php
/**
 *	排行榜相关
 */
defined( 'IN_WEB') or die( 'Include Error!');
class Rank
{
    /**
     *	获取排行榜
     */
    public function friMoneyRank($param)
    {
        $data = array('code' => -1, 'list' => []);
        $uid = oo::functions()->uint($param['uid']);
        if( empty($uid) ){
            return json_encode($data);
        }
        $data = oo::commonOprModel('rank')->getStaRank($uid);
        /**
         * firstName
         */
        $fir  = $data['list']['fir'];
        foreach ($fir as $key=>$f){
            $fir[$key]['nick'] = oo::commonOprModel('member')->getUserFirstName($f['nick']);
        }
        $data['list']['fir'] = $fir;
        $world  = $data['list']['world'];
        foreach ($world as $key=>$w){
            $world[$key]['nick'] = oo::commonOprModel('member')->getUserFirstName($w['nick']);
        }
        $data['list']['world'] = $world;
        $country  = $data['list']['country'];
        foreach ($country as $key=>$c){
            $country[$key]['nick'] = oo::commonOprModel('member')->getUserFirstName($c['nick']);
        }
        $data['list']['country'] = $country;

        return json_encode($data);
    }

}
