public function delete() { $model = M("Arctype"); $id = $_REQUEST["id"]; if (isset($id)) { deleteJG2($id); $this->success('删除成功!'); } }
function deleteJG2($id = 0) { $jg = M("Arctype"); $voList = $jg->where("reid=" . $id)->field("id")->select(); foreach ($voList as $value) { deleteJG2($value["id"]); $jg->where("id=" . $value["id"])->delete(); } $jg->where("id=" . $id)->delete(); }