Есть сайт на yii1, с шаблонизатором twig, бд - PostgreSQL. Сайт ранее успешно работал на старом сервере. После переноса выдает ошибку:
An exception has been thrown during the rendering of a template ("CDbCommand failed to execute the SQL statement: SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near "and"
LINE 3: WHERE customer.visible AND customer.contest_id = and (selec...
^. The SQL statement executed was: SELECT customer.customer_id, count(vote.customer_id) as votes
FROM pr_contest_customer customer LEFT JOIN pr_contest_vote vote ON (vote.customer_id = customer.customer_id)
WHERE customer.visible AND customer.contest_id = and (select id from pr_customer_image image where customer.customer_id = image.customer_id limit 1) is not null
GROUP BY "vote"."customer_id", "customer"."customer_id", "customer"."date_added"
ORDER BY "votes" DESC LIMIT 6") in "/views/site/contest.twig" at line 60.