|
@@ -36,10 +36,19 @@ class Subscribe
|
|
|
# 获取小刊订阅列表
|
|
|
public function getList($id, $type = 4)
|
|
|
{
|
|
|
- $where['type'] = $type;
|
|
|
- $where['data_id'] = $id;
|
|
|
- $where['avatar'] = 'null';
|
|
|
- $data = Dever::db('act/subscribe')->getAll($where);
|
|
|
+ $key = 'subscribe_' . $type . '_' . $id;
|
|
|
+ $data = Dever::cache($key);
|
|
|
+ if (!$data) {
|
|
|
+ $where['type'] = $type;
|
|
|
+ $where['data_id'] = $id;
|
|
|
+ $where['avatar'] = 'null';
|
|
|
+ $data = Dever::db('act/subscribe')->getAll($where);
|
|
|
+
|
|
|
+ if ($data) {
|
|
|
+ Dever::cache($key, $data, 900);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
/*
|
|
|
if ($data) {
|