SQLSTATE[42804]: Datatype mismatch: 7 ERROR: argument of AND must be type boolean, not type integer LINE 1: ...rticle_details a3 ON a2.id = a3.article_id WHERE (a.entity_i... ^