Exemple #1
0
 /**
  * 获取回收站联系人列表
  * @param int $user_id 用户ID
  * @param int $offset  开始位置
  * @param int $limit   获取数量
  * @return array
  */
 public function get_recycled_list($user_id, $offset = 0, $limit = 5000)
 {
     $key = $this->cache_pre . 'recycled_list_' . $user_id . '_' . $offset . '_' . $limit;
     $update_key = $this->cache_pre . 'recycled_list_update_' . $user_id;
     $list = $this->cache->get($key);
     $update_time = $this->cache->get($update_key);
     if (empty($list) or (double) $list['update'] < (double) $update_time) {
         $recycled_list = $this->contact_mapper->get_recycled_list($user_id, $offset, $limit);
         $list = array('data' => $recycled_list, 'update' => microtime(TRUE));
         $this->cache->set($key, $list);
     }
     return !empty($list) ? $list['data'] : array();
 }