/** * 好友列表 * * @access public * @param 无 * @return arrary */ public function getFriend($user_id) { $str = $user_id . '_friend'; $friendList = UserCache::getByKey($str, 'friend_list'); if (!$friendList) { $friendInfo = FriendModel::getFriendList($user_id); foreach ($friendInfo as $key => $value) { $friendList[] = $value['n_id']; } UserCache::setByKey($str, 'friend_list', $friendList); } return $friendList; }