Service.class.php
841 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?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 );
}
}