|
@@ -9,14 +9,22 @@ class Invite
|
|
# 获取小刊的邀请排行
|
|
# 获取小刊的邀请排行
|
|
public function getList($uid, $id, $type = 4, $num = false)
|
|
public function getList($uid, $id, $type = 4, $num = false)
|
|
{
|
|
{
|
|
- $where['source_uid'] = $uid;
|
|
|
|
- $where['type'] = $type;
|
|
|
|
- $where['data_id'] = $id;
|
|
|
|
- if ($num > 0) {
|
|
|
|
- $where['page'] = array(6, 'list');
|
|
|
|
|
|
+ $key = 'invite_' . $uid . '_' . $type . '_' . $id;
|
|
|
|
+ $data = Dever::cache($key);
|
|
|
|
+ if (!$data) {
|
|
|
|
+ $where['source_uid'] = $uid;
|
|
|
|
+ $where['type'] = $type;
|
|
|
|
+ $where['data_id'] = $id;
|
|
|
|
+ if ($num > 0) {
|
|
|
|
+ $where['page'] = array(6, 'list');
|
|
|
|
+ }
|
|
|
|
+ $where['avatar'] = 'null';
|
|
|
|
+ $data = Dever::db('act/invite')->getAll($where);
|
|
|
|
+
|
|
|
|
+ if ($data) {
|
|
|
|
+ Dever::cache($key, $data, 900);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- $where['avatar'] = 'null';
|
|
|
|
- $data = Dever::db('act/invite')->getAll($where);
|
|
|
|
|
|
|
|
/*
|
|
/*
|
|
if ($data) {
|
|
if ($data) {
|