Service.class.php 841 Bytes
<?php

class Lib_Helper_Service
{
    /**
     * 得到存储表
     *
     * @param integer $uid
     * @return string
     */
    public static function getFriendShipTableName($uid, $type = 'attention')
    {
    	return 'tbl_'.$type . str_pad ((int) ($uid % 100 / 10), 2, '0', STR_PAD_LEFT );
    }
    
    /**
     * 得到存储表
     *
     * @param integer $goods_id
     * @return string
     */
    public static function getGoodsTableName($goods_id)
    {
    	return   'tbl_goods_info'. str_pad ((int) ($goods_id/ 100000000), 2, '0', STR_PAD_LEFT );
    }
    
    /**
     * 得到存储表
     *
     * @param integer $id
     * @return string
     */    
    public static function getFragmentDispatchTableName($uid)
    {
        return 'tbl_fragment_dispatch'.str_pad((int) ($uid %100 ), 2, '0', STR_PAD_LEFT );
    }
}