acabei de ver aqui… no copiar e colar não alterei para renderizar para a pagina ‘adminchamadosequipe’… tava ‘admin’…
olha o controller
public function actionAdminchamadosequipe()
{
$model=new CHAMADO('search');
$model->unsetAttributes(); // clear any default values
if(isset($_GET['CHAMADO']))
$model->attributes=$_GET['CHAMADO'];
//$criteria = new CDbCriteria();
//$criteria->compare('STATUS', 1);
//$model=CHAMADO::model()->find($criteria);
$this->render('adminchamadosequipe',array(
'model'=>$model,
));
}
a function search
public function searchchamadosequipe()
{
// @todo Please modify the following code to remove attributes that should not be searched.
$criteria=new CDbCriteria;
$criteria->compare('NUMERO',$this->NUMERO,true);
$criteria->compare('CRITICIDADE',$this->CRITICIDADE,true);
$criteria->compare('DESCRICAO',$this->DESCRICAO,true);
$criteria->compare('CATEGORIA',$this->CATEGORIA,true);
$criteria->compare('TIPO',$this->TIPO,true);
$criteria->compare('DATA',$this->DATA,true);
$criteria->compare('HORA',$this->HORA,true);
//$criteria->compare('NOTIFICACAO',$this->NOTIFICACAO,true);
$criteria->compare('DATA_DISTRIBUICAO',$this->DATA_DISTRIBUICAO,true);
$criteria->compare('DATA_ATENDIMENTO',$this->DATA_ATENDIMENTO,true);
$criteria->compare('MATRICULA_USUARIO',$this->MATRICULA_USUARIO,true);
//$criteria->compare('ID_FUNCIONARIO_FUNCAO_EQUIPE',$this->ID_FUNCIONARIO_FUNCAO_EQUIPE,true);
$criteria->compare('STATUS',1);
return new CActiveDataProvider($this, array(
'criteria'=>$criteria,
));
}
ai descobri que a pagina ta dando erro
CDbException
CDbCommand failed to execute the SQL statement: SQLSTATE[42703]: Undefined column: 7 ERROR: column "status" does not exist
LINE 1: SELECT COUNT(*) FROM "CHAMADO" "t" WHERE STATUS='1'
^. The SQL statement executed was: SELECT COUNT(*) FROM "CHAMADO" "t" WHERE STATUS=:ycp0
/var/www/html/tcc/yii/framework/db/CDbCommand.php(543)
531 {
532 if($this->_connection->enableProfiling)
533 Yii::endProfile('system.db.CDbCommand.query('.$this->getText().$par.')','system.db.CDbCommand.query');
534
535 $errorInfo=$e instanceof PDOException ? $e->errorInfo : null;
536 $message=$e->getMessage();
537 Yii::log(Yii::t('yii','CDbCommand::{method}() failed: {error}. The SQL statement executed was: {sql}.',
538 array('{method}'=>$method, '{error}'=>$message, '{sql}'=>$this->getText().$par)),CLogger::LEVEL_ERROR,'system.db.CDbCommand');
539
540 if(YII_DEBUG)
541 $message.='. The SQL statement executed was: '.$this->getText().$par;
542
543 throw new CDbException(Yii::t('yii','CDbCommand failed to execute the SQL statement: {error}',
544 array('{error}'=>$message)),(int)$e->getCode(),$errorInfo);
545 }
546 }
547
548 /**
549 * Builds a SQL SELECT statement from the given query specification.
550 * @param array $query the query specification in name-value pairs. The following
551 * query options are supported: {@link select}, {@link distinct}, {@link from},
552 * {@link where}, {@link join}, {@link group}, {@link having}, {@link order},
553 * {@link limit}, {@link offset} and {@link union}.
554 * @throws CDbException if "from" key is not present in given query parameter
555 * @return string the SQL statement
como se não tivesse colocandas as aspas na coluna status na clausura where do sql gerado…
q bosta…
tava mo feliz achando que a pagina tava ok…
