D
D
des1roer2015-04-07 11:49:56
Yii
des1roer, 2015-04-07 11:49:56

Yii CDbCriteria array?

It is necessary that the search was on a specific array.
Suppose I rake with

public static function all()
        {
            return CHtml::listData(self::model()->findAll('parent_id = 2'), 'id', 'name');
        }

array of children of the tree.
respectively in admin I write
'ware_id' => array(
                  'name' =>  'ware_id',
                    'value' => '$data->ware->extname',
                    'filter' => Ware::all(),
                ),

How to pass this array to search()?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
des1roer, 2015-04-07
@des1roer

did so

$ware = Ware::model()->findAllByAttributes(array('parent_id'=>2));
                foreach ($ware as $value)
                {
                    $criteria->addInCondition('ware_id', array($value->id),'OR');
                }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question