企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
``` <?php namespace app\agent\controller; use app\agent\model\AgentCategoryModel; use think\Controller; class AdminCategoryController extends Controller { /** * 编辑文章分类 */ public function edit() { $id = $this->request->param('id', 0, 'intval'); if ($id > 0) { $category = AgentCategoryModel::get($id)->toArray(); $agentCategoryModel = new AgentCategoryModel(); $categoriesTree = $agentCategoryModel->adminCategoryTree($category['parent_id'], $id); $this->assign($category); $this->assign('categories_tree', $categoriesTree); return $this->fetch(); } else { $this->error('操作错误!'); } } } ```