I didnt understand your question since i didn’t invent anything…
btw here is the code:
public function search()
{
$criteria=new CDbCriteria;
$criteria->compare('SYSTEM_CODE',$this->SYSTEM_CODE,true);
if(strpos($this->NCODE, '%') === false)
$criteria->compare('LOWER(NCODE)', strtolower($this->NCODE), false);
else
$criteria->compare('LOWER(NCODE)', strtolower(str_replace('%', '', $this->NCODE)), true);
$criteria->compare('LOWER(NDESC)', strtolower($this->NDESC), true);
$criteria->compare('LOWER(ECODE)', strtolower($this->ECODE), false);
$criteria->compare('LOWER(EDESC)', strtolower($this->EDESC), true);
$criteria->compare('LOWER(ACCAO)', strtolower($this->ACCAO), true);
$criteria->compare('LOWER(RESPONSAVEL)', strtolower($this->RESPONSAVEL), true);
$criteria->compare('LOWER(ACCAORECURSO)', strtolower($this->ACCAORECURSO), true);
$criteria->compare('LOWER(RESPONSAVELRECURSO)', strtolower($this->RESPONSAVELRECURSO), true);
$criteria->compare('LOWER(EVENTSTATUS)', strtolower($this->EVENTSTATUS), true);
$criteria->compare('LOWER(SERVICE)', strtolower($this->SERVICE), true);
$criteria->compare('LOWER(OPERATION)', strtolower($this->OPERATION), true);
$criteria->compare('VERSION',$this->VERSION,true);
return new CActiveDataProvider($this, array(
'criteria'=>$criteria,
'pagination'=>array(
'pageSize'=>30
),
));
}
Just added some validation in generated model from crude (added strtolower validations).
My actionAdmin from controller is exactly the same:
public function actionAdmin()
{
$model=new FW_STATUS_TRANSLATE('search');
$model->unsetAttributes(); // clear any default values
if(isset($_GET['FW_STATUS_TRANSLATE']))
$model->attributes=$_GET['FW_STATUS_TRANSLATE'];
$this->render('admin',array(
'model'=>$model,
));
}
Thank you for your time 