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


PHP CDbCriteria::order方法代码示例

本文整理汇总了PHP中CDbCriteria::order方法的典型用法代码示例。如果您正苦于以下问题:PHP CDbCriteria::order方法的具体用法?PHP CDbCriteria::order怎么用?PHP CDbCriteria::order使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CDbCriteria的用法示例。


在下文中一共展示了CDbCriteria::order方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: search

 /**
  * Retrieves a list of models based on the current search/filter conditions.
  *
  * Typical usecase:
  * - Initialize the model fields with values from filter form.
  * - Execute this method to get CActiveDataProvider instance which will filter
  * models according to data in model fields.
  * - Pass data provider to CGridView, CListView or any similar widget.
  *
  * @return CActiveDataProvider the data provider that can return the models
  * based on the search/filter conditions.
  */
 public function search()
 {
     // @todo Please modify the following code to remove attributes that should not be searched.
     $criteria = new CDbCriteria();
     $criteria->compare('question_id', $this->question_id);
     $criteria->compare('question_body', $this->question_body, true);
     $criteria->compare('question_correct_answer_id', $this->question_correct_answer_id);
     $criteria->compare('listening_id', $this->listening_id);
     $criteria->order('RAND()');
     return new CActiveDataProvider($this, array('criteria' => $criteria));
 }
开发者ID:taskinegemen,项目名称:akdeniz_uni,代码行数:23,代码来源:Question.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('id', $this->id);
     $criteria->compare('nombre_comun', $this->nombre_comun, true);
     $criteria->compare('nombre_cientifico', $this->nombre_cientifico, true);
     $criteria->compare('nombre_ingles', $this->nombre_ingles, true);
     $criteria->compare('grupo', $this->grupo, true);
     $criteria->compare('familia', $this->familia, true);
     $criteria->compare('lugar', $this->lugar, true);
     $criteria->compare('talla_captura', $this->talla_captura, true);
     $criteria->compare('aprovechamiento', $this->aprovechamiento, true);
     $criteria->compare('lista_roja_iucn', $this->lista_roja_iucn, true);
     $criteria->compare('veda', $this->veda, true);
     $criteria->compare('arte_de_pesca', $this->arte_de_pesca, true);
     $criteria->compare('tipo_arte_pesca', $this->tipo_arte_pesca, true);
     $criteria->compare('generalidades', $this->generalidades, true);
     $criteria->compare('distribucion', $this->distribucion, true);
     $criteria->compare('foto', $this->foto, true);
     $criteria->compare('html', $this->html, true);
     $criteria->order('nombre_comun ASC');
     return new CActiveDataProvider($this, array('criteria' => $criteria));
 }
开发者ID:calonso-conabio,项目名称:peces,代码行数:29,代码来源:Peces_back.php


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