i encountered a similar problem. only to discover a strange behavior.
this my relation
'trip'=>array(self::BELONGS_TO, 'Holidays', 'tour'),
Initially this was my search
public function search()
{
// @todo Please modify the following code to remove attributes that should not be searched.
$criteria=new CDbCriteria;
$criteria->with = array('trip'=>array('select'=>'id, title'));
$criteria->together = true;
$criteria->condition = 't.tour = :tid';
$criteria->params = array(':tid' => $_GET['id']);
$criteria->compare('t.id',$this->id,true);
$criteria->compare('trip.tour',$this->tour, true);
$criteria->compare('places',$this->places);
$criteria->compare('starrate',$this->starrate,true);
$criteria->compare('comfort',$this->comfort,true);
$criteria->compare('departure',$this->departure,true);
$criteria->compare('priceperson',$this->priceperson,true);
$criteria->compare('singlesupplement',$this->singlesupplement,true);
$criteria->compare('deposit',$this->deposit,true);
return new CActiveDataProvider($this, array(
'criteria'=>$criteria,
));
}
With the above as is it could only return a single row. Then i realized when i comment the following 3 columns it worked and return the number of rows i expected based on my query condition. i don’t understand how the 3 columns could be problematic. There are of decimal(10,2)
public function search()
{
// @todo Please modify the following code to remove attributes that should not be searched.
$criteria=new CDbCriteria;
$criteria->with = array('trip'=>array('select'=>'id, title'));
$criteria->together = true;
$criteria->condition = 't.tour = :tid';
$criteria->params = array(':tid' => $_GET['id']);
$criteria->compare('t.id',$this->id,true);
$criteria->compare('trip.tour',$this->tour, true);
$criteria->compare('places',$this->places);
$criteria->compare('starrate',$this->starrate,true);
$criteria->compare('comfort',$this->comfort,true);
//$criteria->compare('departure',$this->departure,true);
//$criteria->compare('priceperson',$this->priceperson,true);
//$criteria->compare('singlesupplement',$this->singlesupplement,true);
$criteria->compare('deposit',$this->deposit,true);
return new CActiveDataProvider($this, array(
'criteria'=>$criteria,
));
}
The 3 columns fields are all of decimal data type decimal(10,2)