문제

I would like to return selected values to the CGridView (similar to IN query) using the search function that is generated by Yii.To elaborate further let me use the example below:

Here I return values of the based on the value '34455' (fk_recordid)

public function search()
{
    $fk_recordid = '34455'; 
    $criteria=new CDbCriteria;

    $criteria->compare('id',$this->id,true);
    $criteria->compare('fk_recordid',$fk_recordid,true);
    $criteria->compare('babypid',$this->babypid);
    $criteria->compare('babysbn',$this->babysbn);   

    return new CActiveDataProvider(get_class($this), array(
        'criteria'=>$criteria,
    ));
}

How would I change this code to widen the fk_recordid criteria i.e return records based on several values such as '34455','47859','78956' .....

올바른 솔루션이 없습니다

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top