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


PHP CDbCriteria类代码示例

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


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

示例1: search

 /**
  * @return CActiveDataProvider
  */
 public function search()
 {
     $criteria = new CDbCriteria();
     $criteria->compare('id', $this->id);
     $criteria->compare('name', $this->name, true);
     return new CActiveDataProvider($this, ['criteria' => $criteria]);
 }
开发者ID:yupe,项目名称:yupe,代码行数:10,代码来源:OrderStatus.php

示例2: search

 public function search()
 {
     $criteria = new CDbCriteria();
     $criteria->compare('id_tipo_riesgo', $this->id_tipo_riesgo);
     $criteria->compare('nombre', $this->nombre, true);
     return new CActiveDataProvider($this, array('criteria' => $criteria));
 }
开发者ID:VrainSystem,项目名称:Proyecto_PROFIT,代码行数:7,代码来源:BaseTipoRiesgo.php

示例3: displayDataset

 public function displayDataset($ids)
 {
     $criteria = new CDbCriteria();
     $criteria->addInCondition("id", $ids);
     $datasets = Dataset::model()->findAll($criteria);
     $this->generateFeed($datasets);
 }
开发者ID:jessesiu,项目名称:GigaDBV3,代码行数:7,代码来源:RssController.php

示例4: actionIndex

 /**
  * 生成首页
  *
  */
 public function actionIndex()
 {
     //print_r(Yii::app()->user->getState('username'));
     //先获取当前是否有页码信息
     $pages['pageNum'] = Yii::app()->getRequest()->getParam("pageNum", 1);
     //当前页
     $pages['countPage'] = Yii::app()->getRequest()->getParam("countPage", 0);
     //总共多少记录
     $pages['numPerPage'] = Yii::app()->getRequest()->getParam("numPerPage", 50);
     //每页多少条数据
     $pages['tmstart'] = Yii::app()->getRequest()->getParam("tmstart", date('Ym'));
     //开始月份
     $pages['tmstop'] = Yii::app()->getRequest()->getParam("tmstop", date('Ym'));
     //结束月份
     $pages['srh_service'] = Yii::app()->getRequest()->getParam("srh_service", "");
     //按餐厅名称查询
     $criteria = new CDbCriteria();
     !empty($pages['srh_service']) && $criteria->addCondition('type=' . $pages['srh_service']);
     $criteria->addCondition('`month`>=' . $pages['tmstart']);
     $criteria->addCondition('`month`<=' . $pages['tmstop']);
     $pages['countPage'] = AppBsMoney::model()->count($criteria);
     $criteria->limit = $pages['numPerPage'];
     $criteria->offset = $pages['numPerPage'] * ($pages['pageNum'] - 1);
     $allList = AppBsMoney::model()->findAll($criteria);
     $this->renderPartial('index', array('models' => $allList, 'pages' => $pages), false, true);
 }
开发者ID:a707937337,项目名称:bscy,代码行数:30,代码来源:AdminMoneyController.php

示例5: run

 public function run()
 {
     $params = array();
     $criteria = new CDbCriteria();
     //        $criteria->select = array('id,username,fullname,phone,address,status');
     $criteria->select = '*';
     if (isset($this->team_lear_id) and $this->team_lear_id != '') {
         $criteria->addCondition('team_lear_id=' . $this->team_lear_id);
     }
     $criteria->params = $params;
     $total = ATrainingTeam::model()->count($criteria);
     $offset = $this->limit * ($this->page - 1);
     $criteria->limit = $this->limit;
     $criteria->offset = $offset;
     $data = ATrainingTeam::model()->findAll($criteria);
     $listTrainee = array();
     if (!empty($data)) {
         foreach ($data as $item) {
             $listTrainee[] = CJSON::decode(CJSON::encode($item->pls_user));
         }
     }
     $data = $listTrainee;
     $pages = new CPagination($total);
     $pages->pageSize = $this->limit;
     $pages->applyLimit($criteria);
     $this->render($this->view, array('data' => $data, 'pages' => $pages));
 }
开发者ID:nguyendvphp,项目名称:onlinetraining,代码行数:27,代码来源:wg_dataUser_Team.php

示例6: search

 public function search()
 {
     $criteria = new CDbCriteria();
     $criteria->compare('id', $this->id, true);
     $criteria->compare('html', $this->html, true);
     return new CActiveDataProvider($this, array('criteria' => $criteria));
 }
开发者ID:kostya1017,项目名称:our,代码行数:7,代码来源:BlocEditor.php

示例7: 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()
 {
     // Warning: Please modify the following code to remove attributes that
     // should not be searched.
     $criteria = new CDbCriteria();
     $criteria->compare('id', $this->id);
     $criteria->compare('title', $this->title, true);
     $criteria->compare('catalog_id', $this->catalog_id);
     $criteria->compare('soft_icon', $this->soft_icon, true);
     $criteria->compare('cover_image', $this->cover_image, true);
     $criteria->compare('soft_file', $this->soft_file, true);
     $criteria->compare('language', $this->language, true);
     $criteria->compare('softtype', $this->softtype, true);
     $criteria->compare('os', $this->os, true);
     $criteria->compare('softrank', $this->softrank, true);
     $criteria->compare('softsize', $this->softsize, true);
     $criteria->compare('softlink', $this->softlink, true);
     $criteria->compare('introduce', $this->introduce, true);
     $criteria->compare('content', $this->content, true);
     $criteria->compare('update_time', $this->update_time, true);
     $criteria->compare('create_time', $this->create_time, true);
     $criteria->compare('view_count', $this->view_count);
     $criteria->compare('down_count', $this->down_count);
     $criteria->compare('status', $this->status, true);
     $criteria->compare('tags', $this->tags, true);
     $criteria->compare('seo_title', $this->seo_title, true);
     $criteria->compare('seo_description', $this->seo_description, true);
     $criteria->compare('seo_keywords', $this->seo_keywords, true);
     return new CActiveDataProvider('Soft', array('criteria' => $criteria));
 }
开发者ID:jerrylsxu,项目名称:yiifcms,代码行数:41,代码来源:Soft.php

示例8: 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('name', $this->name, true);
     $criteria->compare('name_en', $this->name_en, true);
     $criteria->compare('non_utf8_name', $this->non_utf8_name, true);
     $criteria->compare('parentid', $this->parentid);
     $criteria->compare('description', $this->description, true);
     $criteria->compare('description_en', $this->description_en, true);
     $criteria->compare('order', $this->order);
     $criteria->compare('active', $this->active);
     $criteria->compare('metadescription', $this->metadescription, true);
     $criteria->compare('metakeywords', $this->metakeywords, true);
     //$criteria->compare('delete',$this->delete);
     $criteria->addCondition("t.delete=0");
     $criteria->compare('createdby', $this->createdby);
     $criteria->compare('createdatetime', $this->createdatetime, true);
     $criteria->compare('lastmodifiedby', $this->lastmodifiedby);
     $criteria->compare('lastupdatedatetime', $this->lastupdatedatetime, true);
     //$criteria->order = 't.createdatetime DESC';
     return new CActiveDataProvider($this, array('criteria' => $criteria));
 }
开发者ID:phantsang,项目名称:xzsUuJg0keDWW5Rx679PHBVBJ,代码行数:29,代码来源:ProductCategories.php

示例9: search_cabecera

 public function search_cabecera($id)
 {
     // @todo Please modify the following code to remove attributes that should not be searched.
     $criteria = new CDbCriteria();
     $criteria->compare('id', $this->id);
     $criteria->compare('hidfactura', $this->hidfactura, true);
     $criteria->compare('item', $this->item, true);
     $criteria->compare('hidkardex', $this->hidkardex, true);
     $criteria->compare('iduser', $this->iduser);
     $criteria->compare('fechacrea', $this->fechacrea, true);
     $criteria->compare('hidalentrega', $this->hidalentrega, true);
     $criteria->compare('identrega', $this->identrega, true);
     $criteria->compare('iddetcompra', $this->iddetcompra, true);
     $criteria->compare('cant', $this->cant);
     $criteria->compare('fechaentrega', $this->fechaentrega, true);
     $criteria->compare('idkardex', $this->idkardex, true);
     $criteria->compare('punitentrega', $this->punitentrega);
     $criteria->compare('codart', $this->codart, true);
     $criteria->compare('cantcompras', $this->cantcompras);
     $criteria->compare('punitcompra', $this->punitcompra);
     $criteria->compare('itemcompra', $this->itemcompra, true);
     $criteria->compare('descri', $this->descri, true);
     $criteria->compare('codentro', $this->codentro, true);
     $criteria->addCondition("hidfactura=:identidad");
     $criteria->params = array(":identidad" => (int) $id);
     $criteria->order = "itemcompra ASC ";
     return new CActiveDataProvider($this, array('criteria' => $criteria));
 }
开发者ID:hipogea,项目名称:zega,代码行数:28,代码来源:VwDetalleingresofactura.php

示例10: get_data

 private function get_data($filter = '', $limit = 5, $offset = 0)
 {
     $criteria = new CDbCriteria();
     if (is_array($filter)) {
         if (isset($filter['application_id'])) {
             $criteria->compare('application_id', $filter['application_id']);
         } else {
             $criteria->addCondition('application_id IS NULL');
         }
         if (isset($filter['project_id'])) {
             $criteria->compare('project_id', $filter['project_id']);
         }
     }
     $count = Notes::model()->count($criteria);
     $criteria->limit = $limit;
     $criteria->offset = $offset;
     $criteria->order = 'date_created DESC';
     $model = Notes::model()->findAll($criteria);
     $data = array();
     //XSS Purifier here
     // $p = new CHtmlPurifier();
     // $p->options = array('URI.AllowedSchemes'=>array(
     //     'http' => true,
     //     'https' => true,
     // ));
     foreach ($model as $row) {
         $data[] = array('note_id' => $row->note_id, 'project_id' => $row->project_id, 'application_id' => $row->application_id, 'notes' => str_replace('<', '&lt', $row->notes), 'date_created' => $row->date_created, 'date_updated' => $row->date_updated, 'created_by' => $row->created_by, 'updated_by' => $row->updated_by);
     }
     return array('data' => $data, 'data_count' => count($data), 'total_count' => $count);
 }
开发者ID:emircado,项目名称:pamgmt,代码行数:30,代码来源:NotesController.php

示例11: 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('Id', $this->Id);
     $criteria->compare('Ext', $this->Ext, true);
     $criteria->compare('Line', $this->Line, true);
     $criteria->compare('Hreg', $this->Hreg, true);
     $criteria->compare('HN', $this->HN, true);
     $criteria->compare('SessNo', $this->SessNo, true);
     $criteria->compare('BegHd', $this->BegHd, true);
     $criteria->compare('HdMode', $this->HdMode, true);
     $criteria->compare('ClaimAcc', $this->ClaimAcc, true);
     $criteria->compare('Payers', $this->Payers, true);
     $criteria->compare('DlzNew', $this->DlzNew, true);
     $criteria->compare('EpoTn', $this->EpoTn, true);
     $criteria->compare('Epounit', $this->Epounit, true);
     $criteria->compare('Hct', $this->Hct, true);
     $criteria->compare('Paychk', $this->Paychk, true);
     $criteria->compare('Amount', $this->Amount, true);
     $criteria->compare('HDCharge', $this->HDCharge, true);
     $criteria->compare('Payrate', $this->Payrate, true);
     $criteria->compare('AddiPay', $this->AddiPay, true);
     $criteria->compare('Payable', $this->Payable, true);
     $criteria->compare('EHS', $this->EHS, true);
     $criteria->compare('BF', $this->BF, true);
     $criteria->compare('CheckCode', $this->CheckCode, true);
     $criteria->compare('Flag', $this->Flag, true);
     $criteria->compare('D_update', $this->D_update, true);
     return new CActiveDataProvider($this, array('criteria' => $criteria));
 }
开发者ID:kimniyom,项目名称:craimreport,代码行数:43,代码来源:HealthInsurance.php

示例12: search

 public function search()
 {
     $criteria = new CDbCriteria();
     $criteria->order = 'id DESC';
     $criteria->compare('apartment_id', $this->apartment_id, true);
     return new CActiveDataProvider($this, array('criteria' => $criteria, 'pagination' => array('pageSize' => param('adminPaginationPageSize', 20))));
 }
开发者ID:barricade86,项目名称:raui,代码行数:7,代码来源:Bookingcalendar.php

示例13: 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('type', $this->type, true);
     return new CActiveDataProvider($this, array('criteria' => $criteria));
 }
开发者ID:alikh31,项目名称:FeedCloud,代码行数:19,代码来源:SwotType.php

示例14: search

 public function search()
 {
     $criteria = new CDbCriteria();
     $criteria->compare('LoginID', $this->LoginID);
     $criteria->compare('User', $this->User, true);
     $criteria->compare('Pass', $this->Pass, true);
     $criteria->compare('State', $this->State);
     $criteria->compare('Type', $this->Type);
     $criteria->compare('AreaID', $this->AreaID);
     $criteria->compare('Param', $this->Param);
     $criteria->compare('Comment', $this->Comment, true);
     $criteria->compare('TechComment', $this->TechComment, true);
     $criteria->compare('AddTime', $this->AddTime, true);
     $criteria->compare('LastTime', $this->LastTime, true);
     $criteria->compare('SendInt', $this->SendInt);
     $criteria->compare('Version', $this->Version, true);
     $criteria->compare('AppType', $this->AppType);
     $criteria->compare('AppVer', $this->AppVer, true);
     $criteria->compare('UpdTime', $this->UpdTime, true);
     $criteria->compare('AreaAdmin', $this->AreaAdmin);
     $criteria->compare('PersistCon', $this->PersistCon);
     $criteria->compare('LangID', $this->LangID);
     $criteria->compare('Email', $this->Email, true);
     $criteria->compare('MaxSessions', $this->MaxSessions);
     return new CActiveDataProvider($this, array('criteria' => $criteria));
 }
开发者ID:azzazello,项目名称:glonassCRM,代码行数:26,代码来源:BaseLogin.php

示例15: search2

 public function search2()
 {
     // @todo Please modify the following code to remove attributes that should not be searched.
     $criteria = new CDbCriteria();
     if (!empty($this->from_date) && empty($this->to_date)) {
         $criteria->condition = "TGL_PENGADAAN>='{$this->from_date}'";
         $criteria->compare('NAMA_TOKO', $this->NAMA_TOKO, true);
         $criteria->compare('STATUS', $this->STATUS, true);
     } else {
         if (empty($this->from_date) && !empty($this->to_date)) {
             $criteria->condition = "TGL_PENGADAAN<='{$this->to_date}'";
             $criteria->compare('NAMA_TOKO', $this->NAMA_TOKO, true);
             $criteria->compare('STATUS', $this->STATUS, true);
         } else {
             if (!empty($this->from_date) && !empty($this->to_date)) {
                 $criteria->condition = "TGL_PENGADAAN>='{$this->from_date}' and TGL_PENGADAAN<='{$this->to_date}'";
                 $criteria->compare('NAMA_TOKO', $this->NAMA_TOKO, true);
                 $criteria->compare('STATUS', $this->STATUS, true);
             } else {
                 $criteria->compare('NAMA_TOKO', $this->NAMA_TOKO, true);
                 $criteria->compare('STATUS', $this->STATUS, true);
             }
         }
     }
     return new CActiveDataProvider($this, array('criteria' => $criteria, 'sort' => array('defaultOrder' => 'TGL_PENGADAAN DESC'), 'pagination' => array('pageSize' => '10')));
 }
开发者ID:aunorafiq,项目名称:jks,代码行数:26,代码来源:Pengadaan.php


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