当前位置: 首页>>代码示例>>PHP>>正文


PHP CDbCriteria::condition方法代码示例

本文整理汇总了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')));
 }
开发者ID:kuzmina-mariya,项目名称:gallery,代码行数:27,代码来源:MenuItem.php

示例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']]);
 }
开发者ID:kuzmina-mariya,项目名称:4seasons,代码行数:27,代码来源:MenuItem.php

示例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']]);
 }
开发者ID:syrexby,项目名称:domovoishop.by,代码行数:25,代码来源:MenuItem.php


注:本文中的CDbCriteria::condition方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。