FeedModel::getCollectionFeed PHP Method

getCollectionFeed() public method

获取指定用户收藏的分享列表,默认为当前登录用户
public getCollectionFeed ( array $map, integer $limit = 10, integer $uid = '' ) : array
$map array 查询条件
$limit integer 结果集数目,默认为10
$uid integer 指定用户ID,默认为空
return array 指定用户收藏的分享列表,默认为当前登录用户
    public function getCollectionFeed($map, $limit = 10, $uid = '')
    {
        $map['uid'] = empty($uid) ? $_SESSION['mid'] : $uid;
        $map['source_table_name'] = 'feed';
        $table = "{$this->tablePrefix}collection";
        $feedlist = $this->table($table)->where($map)->field('source_id AS feed_id')->order('source_id DESC')->findPage($limit);
        $feed_ids = getSubByKey($feedlist['data'], 'feed_id');
        $feedlist['data'] = $this->getFeeds($feed_ids);
        return $feedlist;
    }