-- CMS 产品与产品分类表(对应 backend 租户端 apps/cms/product 模块) -- 接口:/backend/productsList、/backend/addProducts、/backend/editProducts/:id、/backend/deleteProducts/:id -- /backend/productsTypesList、/backend/addProductsTypes、/backend/editProductsTypes/:id、/backend/deleteProductsTypes/:id CREATE TABLE IF NOT EXISTS yz_cms_product ( id bigint unsigned NOT NULL AUTO_INCREMENT, tid bigint unsigned NOT NULL DEFAULT 0 COMMENT '租户ID', title varchar(100) NOT NULL DEFAULT '' COMMENT '产品名称', thumb varchar(500) NOT NULL DEFAULT '' COMMENT '产品图片', `desc` varchar(500) NOT NULL DEFAULT '' COMMENT '产品描述', content mediumtext COMMENT '产品内容(富文本)', url varchar(500) NOT NULL DEFAULT '' COMMENT '跳转地址', sort int NOT NULL DEFAULT 0 COMMENT '排序', status tinyint NOT NULL DEFAULT 1 COMMENT '状态 1启用 0禁用', create_time datetime NOT NULL, update_time datetime DEFAULT NULL, delete_time datetime DEFAULT NULL COMMENT '软删除时间', PRIMARY KEY (id), KEY idx_tid_status (tid, status) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='CMS产品'; CREATE TABLE IF NOT EXISTS yz_cms_product_category ( id bigint unsigned NOT NULL AUTO_INCREMENT, tid bigint unsigned NOT NULL DEFAULT 0 COMMENT '租户ID', title varchar(100) NOT NULL DEFAULT '' COMMENT '分类名称', pid bigint unsigned NOT NULL DEFAULT 0 COMMENT '父级分类ID,0为顶级', `desc` varchar(500) NOT NULL DEFAULT '' COMMENT '分类描述', sort int NOT NULL DEFAULT 0 COMMENT '排序', status tinyint NOT NULL DEFAULT 1 COMMENT '状态 1启用 0禁用', create_time datetime NOT NULL, update_time datetime DEFAULT NULL, delete_time datetime DEFAULT NULL COMMENT '软删除时间', PRIMARY KEY (id), KEY idx_tid_pid (tid, pid) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='CMS产品分类';