當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。