本文整理汇总了PHP中CDbCriteria::condition方法的典型用法代码示例。如果您正苦于以下问题:PHP CDbCriteria::condition方法的具体用法?PHP CDbCriteria::condition怎么用?PHP CDbCriteria::condition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDbCriteria
的用法示例。
在下文中一共展示了CDbCriteria::condition方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: search
/**
* Retrieves a list of models based on the current search/filter conditions.
* @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
*/
public function search()
{
// Warning: Please modify the following code to remove attributes that
// should not be searched.
$criteria = new CDbCriteria();
$criteria->compare('t.id', $this->id, true);
$criteria->compare('t.parent_id', $this->parent_id, true);
$criteria->compare('t.menu_id', $this->menu_id, true);
$criteria->compare('t.title', $this->title, true);
$criteria->compare('t.href', $this->href, true);
if ($this->condition_name != '0') {
$criteria->compare('t.condition_name', $this->condition_name, true);
if ($this->condition_name != '') {
$criteria->compare('t.condition_denial', $this->condition_denial);
}
} else {
$criteria->condition('t.condition_name', '');
}
$criteria->compare('t.sort', $this->sort);
$criteria->compare('t.status', $this->status);
$criteria->with = array('menu', 'parent');
return new yupe\components\DTreeActiveDataProvider($this, array('pagination' => false, 'criteria' => $criteria, 'childRelation' => 'childItems', 'sort' => array('defaultOrder' => 't.sort ASC')));
}
示例2: search
/**
* Retrieves a list of models based on the current search/filter conditions.
* @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
*/
public function search()
{
// Warning: Please modify the following code to remove attributes that
// should not be searched.
$criteria = new CDbCriteria();
$criteria->compare('t.id', $this->id);
$criteria->compare('t.parent_id', $this->parent_id);
$criteria->compare('t.menu_id', $this->menu_id);
$criteria->compare('t.title', $this->title, true);
$criteria->compare('t.href', $this->href, true);
if ($this->condition_name != '0') {
$criteria->compare('t.condition_name', $this->condition_name, true);
if ($this->condition_name != '') {
$criteria->compare('t.condition_denial', $this->condition_denial);
}
} else {
$criteria->condition('t.condition_name', '');
}
$criteria->compare('t.sort', $this->sort);
$criteria->compare('t.status', $this->status);
$criteria->with = ['menu', 'parent'];
return new CActiveDataProvider(get_class($this), ['criteria' => $criteria, 'sort' => ['defaultOrder' => 't.sort']]);
}
示例3: search
/**
* Retrieves a list of models based on the current search/filter conditions.
* @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
*/
public function search()
{
$criteria = new CDbCriteria();
$criteria->compare('t.id', $this->id, true);
$criteria->compare('t.parent_id', $this->parent_id, true);
$criteria->compare('t.menu_id', $this->menu_id, true);
$criteria->compare('t.title', $this->title, true);
$criteria->compare('t.href', $this->href, true);
if ($this->condition_name != '0') {
$criteria->compare('t.condition_name', $this->condition_name, true);
if ($this->condition_name != '') {
$criteria->compare('t.condition_denial', $this->condition_denial);
}
} else {
$criteria->condition('t.condition_name', '');
}
$criteria->compare('t.sort', $this->sort);
$criteria->compare('t.status', $this->status);
$criteria->with = ['menu', 'parent'];
return new CActiveDataProvider(get_class($this), ['criteria' => $criteria, 'sort' => ['defaultOrder' => 't.sort']]);
}