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 {
|
||||
// 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
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue