API Improvements: - api/businesses/get.cfm: Fetch address from Addresses table, hours from Hours table - api/tasks/getDetails.cfm: Add CustomerPhone field from UserContactNumber - api/orders/getDetail.cfm: New endpoint for order details with line items - api/Application.cfm: Add new admin endpoints to public allowlist Admin Tools: - api/admin/beaconStatus.cfm: View all beacon-to-business mappings - api/admin/updateBeaconMapping.cfm: Change beacon business assignment - api/admin/setupBigDeansInfo.cfm: Set Big Dean's address and hours - api/admin/listTables.cfm: List all database tables - api/admin/describeTable.cfm: Get table structure and sample data - api/admin/randomizePrices.cfm: Randomize item prices for testing - Various Big Dean's debug/update scripts Portal Enhancements: - Enhanced CSS styling for portal pages - Improved portal.js functionality 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
53 lines
1.5 KiB
Text
53 lines
1.5 KiB
Text
<cfsetting showdebugoutput="false">
|
|
<cfsetting enablecfoutputonly="true">
|
|
<cfcontent type="application/json; charset=utf-8" reset="true">
|
|
|
|
<cfscript>
|
|
businessID = 27;
|
|
|
|
// Run the EXACT query from getForBuilder.cfm
|
|
qCategories = queryExecute("
|
|
SELECT DISTINCT
|
|
p.ItemID as CategoryID,
|
|
p.ItemName as CategoryName,
|
|
p.ItemSortOrder
|
|
FROM Items p
|
|
INNER JOIN Items c ON c.ItemParentItemID = p.ItemID
|
|
WHERE p.ItemBusinessID = :businessID
|
|
AND p.ItemParentItemID = 0
|
|
AND p.ItemIsActive = 1
|
|
AND NOT EXISTS (
|
|
SELECT 1 FROM ItemTemplateLinks tl WHERE tl.TemplateItemID = p.ItemID
|
|
)
|
|
ORDER BY p.ItemSortOrder, p.ItemName
|
|
", { businessID: businessID });
|
|
|
|
cats = [];
|
|
for (c in qCategories) {
|
|
arrayAppend(cats, {
|
|
"CategoryID": c.CategoryID,
|
|
"CategoryName": c.CategoryName
|
|
});
|
|
}
|
|
|
|
// Also check raw counts
|
|
rawCount = queryExecute("
|
|
SELECT COUNT(*) as cnt FROM Items
|
|
WHERE ItemBusinessID = :bizId AND ItemParentItemID = 0 AND ItemIsActive = 1
|
|
", { bizId: businessID });
|
|
|
|
childrenCount = queryExecute("
|
|
SELECT COUNT(DISTINCT c.ItemParentItemID) as cnt
|
|
FROM Items c
|
|
INNER JOIN Items p ON p.ItemID = c.ItemParentItemID
|
|
WHERE p.ItemBusinessID = :bizId AND p.ItemParentItemID = 0
|
|
", { bizId: businessID });
|
|
|
|
writeOutput(serializeJSON({
|
|
"OK": true,
|
|
"CategoriesFromQuery": cats,
|
|
"CategoryCount": arrayLen(cats),
|
|
"TotalTopLevelItems": rawCount.cnt,
|
|
"TopLevelItemsWithChildren": childrenCount.cnt
|
|
}));
|
|
</cfscript>
|