ChannelModel::deleteAssociatedData PHP Method

deleteAssociatedData() public method

删除分类关联信息
public deleteAssociatedData ( integer $cid ) : boolean
$cid integer 分类ID
return boolean 是否删除成功
    public function deleteAssociatedData($cid)
    {
        if (empty($cid)) {
            return false;
        }
        // 删除频道分类下的数据
        $map['channel_category_id'] = $cid;
        $this->where($map)->delete();
        // 删除频道关注下的数据
        D('ChannelFollow', 'channel')->where($map)->delete();
        return true;
    }