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; }