Converts 200+ endpoint files to use queryTimed() wrapper which tracks DB query count and execution time. Restores perf dashboard files that were accidentally moved to _scripts/. Includes portal UI updates.
38 lines
1.2 KiB
Text
38 lines
1.2 KiB
Text
<cfsetting showdebugoutput="false">
|
|
<cfsetting enablecfoutputonly="true">
|
|
<cfcontent type="application/json; charset=utf-8" reset="true">
|
|
|
|
<cfscript>
|
|
bizId = 27;
|
|
|
|
// These are the items that were deactivated by fixBigDeansCategories.cfm
|
|
deactivatedIds = [11177, 11180, 11183, 11186, 11190, 11193, 11196, 11199, 11204, 11212, 11220, 11259];
|
|
|
|
qDeactivated = queryTimed("
|
|
SELECT i.ID, i.Name, i.ParentItemID, i.IsActive, i.IsCollapsible,
|
|
(SELECT COUNT(*) FROM Items c WHERE c.ParentItemID = i.ID) as ChildCount,
|
|
(SELECT GROUP_CONCAT(c.Name) FROM Items c WHERE c.ParentItemID = i.ID) as Children
|
|
FROM Items i
|
|
WHERE i.ID IN (:ids)
|
|
ORDER BY i.ID
|
|
", { ids: { value: arrayToList(deactivatedIds), list: true } }, { datasource: "payfrit" });
|
|
|
|
items = [];
|
|
for (row in qDeactivated) {
|
|
arrayAppend(items, {
|
|
"ItemID": row.ID,
|
|
"Name": row.Name,
|
|
"ParentID": row.ParentItemID,
|
|
"IsActive": row.IsActive,
|
|
"IsCollapsible": row.IsCollapsible,
|
|
"ChildCount": row.ChildCount,
|
|
"Children": row.Children
|
|
});
|
|
}
|
|
|
|
writeOutput(serializeJSON({
|
|
"OK": true,
|
|
"Message": "These items were deactivated thinking they were fake categories",
|
|
"DeactivatedItems": items
|
|
}));
|
|
</cfscript>
|