ChannelModel::getCategoryByUserBind PHP Method

getCategoryByUserBind() public method

获取指定用户所绑定频道分类的数组
public getCategoryByUserBind ( integer $uid ) : array
$uid integer 用户ID
return array 指定用户所绑定频道分类的数组
    public function getCategoryByUserBind($uid)
    {
        $extraHash = D('channel_category')->where('ext IS NOT NULL')->getHashList('channel_category_id', 'ext');
        $data = array();
        foreach ($extraHash as $key => $val) {
            $extra = unserialize($val);
            if (!empty($extra['user_bind'])) {
                in_array($uid, explode(',', $extra['user_bind'])) && ($data[] = $key);
            }
        }
        return $data;
    }