I'm using Yii CDBCriteria to find records.
I have to put a string value as a custom column in "SELECT" like this:
$criteria = new CDbCriteria;
$criteria->select = array('*, DATE_ADD(createdon, INTERVAL :timezonediff SECOND) as createdon' );
$criteria->condition = "some_amount > 1000";
$criteria->params = array(':timezonediff' => "10800");
$transModel = new TransactionModel;
I'm having a problem where I'm not able to provide the value for ":timezonediff" token in SELECT.
$criteria->params
is only working for the tokens in condition but not for SELECT.
I even tried to give an array in $criteria->select
, but it didn't work.
Does anyone know if I'm doing something wrong here ?