diff --git a/smart_service/apis/publish_api.py b/smart_service/apis/publish_api.py index 3e42695..c5c57af 100644 --- a/smart_service/apis/publish_api.py +++ b/smart_service/apis/publish_api.py @@ -202,10 +202,15 @@ def json_grouping(args, language): subsys['Config Kilometer'] = kms for k in docs_child: if k['variant_mapping'] == d and k['system'] == i and k['sub_system'] == j: - proc_details = frappe.db.sql('''select procedure_name, step_name, content_type, GROUP_CONCAT(case when content_type='Link' Then system_id else content end) as content, - GROUP_CONCAT(file) as file,GROUP_CONCAT(DISTINCT idx order by idx) as display_order, idx from {}.tabProcedure_Details - where parent ='{}' group by procedure_name,step_name,content_type,content order by idx asc; '''.format( - current_db_name, k['procedure_link']), as_dict=True) + # proc_details = frappe.db.sql('''select procedure_name, step_name, content_type, GROUP_CONCAT(case when content_type='Link' Then system_id else content end) as content, + # GROUP_CONCAT(file) as file,GROUP_CONCAT(DISTINCT idx order by idx) as display_order, idx from {}.tabProcedure_Details + # where parent ='{}' group by procedure_name,step_name,content_type,content order by idx asc; '''.format( + # current_db_name, k['procedure_link']), as_dict=True) + + proc_details = frappe.db.sql('''select procedure_name, step_name, content_type, content, + file,idx as display_order from {}.tabProcedure_Details + where parent ='{}' order by idx asc; '''.format(current_db_name, k['procedure_link']), as_dict=True) + proc_data = get_parent_map( proc_details, 'procedure_name') total_count += len(proc_data)