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:
parent
e586a62a95
commit
245a37aeab
1 changed files with 3 additions and 2 deletions
|
|
@ -39,12 +39,13 @@ if (businessId <= 0) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Get employees for this business with user details
|
// Get employees for this business with user details
|
||||||
|
// Cast BIT to INT to avoid binary comparison issues
|
||||||
qTeam = queryExecute("
|
qTeam = queryExecute("
|
||||||
SELECT
|
SELECT
|
||||||
e.EmployeeID,
|
e.EmployeeID,
|
||||||
e.UserID,
|
e.UserID,
|
||||||
e.EmployeeStatusID,
|
e.EmployeeStatusID,
|
||||||
e.EmployeeIsActive,
|
CAST(e.EmployeeIsActive AS UNSIGNED) AS EmployeeIsActive,
|
||||||
u.UserFirstName,
|
u.UserFirstName,
|
||||||
u.UserLastName,
|
u.UserLastName,
|
||||||
u.UserEmailAddress,
|
u.UserEmailAddress,
|
||||||
|
|
@ -76,7 +77,7 @@ try {
|
||||||
"Phone": row.UserContactNumber,
|
"Phone": row.UserContactNumber,
|
||||||
"StatusID": row.EmployeeStatusID,
|
"StatusID": row.EmployeeStatusID,
|
||||||
"StatusName": row.StatusName,
|
"StatusName": row.StatusName,
|
||||||
"IsActive": row.EmployeeIsActive == 1
|
"IsActive": val(row.EmployeeIsActive) == 1
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue