SQLSTATE[42804]: Datatype mismatch: 7 ERROR: argument of AND must be type boolean, not type integer LINE 1: ...a.id WHERE (a.parent_id = -1 AND a.status = 2 AND a.id ) LI... ^