Fix IsActive bit field comparison in team API

Cast BIT(1) to UNSIGNED INT in SQL and use val() for comparison
to correctly handle MySQL bit fields in ColdFusion/Lucee.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
John Mizerek 2026-01-11 17:39:48 -08:00
parent e586a62a95
commit 245a37aeab

View file

@ -39,12 +39,13 @@ if (businessId <= 0) {
try {
// Get employees for this business with user details
// Cast BIT to INT to avoid binary comparison issues
qTeam = queryExecute("
SELECT
e.EmployeeID,
e.UserID,
e.EmployeeStatusID,
e.EmployeeIsActive,
CAST(e.EmployeeIsActive AS UNSIGNED) AS EmployeeIsActive,
u.UserFirstName,
u.UserLastName,
u.UserEmailAddress,
@ -76,7 +77,7 @@ try {
"Phone": row.UserContactNumber,
"StatusID": row.EmployeeStatusID,
"StatusName": row.StatusName,
"IsActive": row.EmployeeIsActive == 1
"IsActive": val(row.EmployeeIsActive) == 1
});
}