SmartERP数据导入指引

在SmartERP中导入类目,比如文章,产品类目后,需要执行手动更新表的 parent_ids 字段,系统引导界面导入数据会自动操作,无需理会:

a. 文章类目:UPDATE e_article_category SET parent_ids = STUFF((SELECT ',' + CAST(t.id AS varchar(max)) FROM dbo.ef_category_parent21(ac.id) t ORDER BY level DESC FOR XML PATH(''), TYPE).value('text()[1]', 'varchar(max)'), 1, 1, '') FROM e_article_category AS ac OUTER APPLY ef_category_children21(ac.id) AS cc;

b. 产品类目:UPDATE e_product_category SET parent_ids = STUFF((SELECT ',' + CAST(t.id AS varchar(max)) FROM dbo.ef_category_parent22(ac.id) t ORDER BY level DESC FOR XML PATH(''), TYPE).value('text()[1]', 'varchar(max)'), 1, 1, '') FROM e_product_category AS ac OUTER APPLY ef_category_children22(ac.id) AS cc;

c. 客户类目:UPDATE e_customer_category SET parent_ids = STUFF((SELECT ',' + CAST(t.id AS varchar(max)) FROM dbo.ef_category_parent6(ac.id) t ORDER BY level DESC FOR XML PATH(''), TYPE).value('text()[1]', 'varchar(max)'), 1, 1, '') FROM e_customer_category AS ac OUTER APPLY ef_category_children6(ac.id) AS cc;