//解决方法 public function delete(){ $id = I('id',0,'intval'); if (M('blog')->where(array('id' => $id))->delete()) { M('blog_attr')->where(array('bid' => $id))->delete(); $this->success('删除成功',U(GROUP_NAME . '/Blog/index')); } else { $this->error('删除失败'); } }