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


PHP ActiveQuery::andFilterWhere方法代码示例

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


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

示例1: filterAttributes

 /**
  * Фильтрация по атрибутам
  */
 protected function filterAttributes()
 {
     if ($this->_mainQuery) {
         if ($this->hasAttribute('id')) {
             $this->_mainQuery->andFilterWhere(['id' => $this->id]);
         }
         if ($this->hasAttribute('user_id')) {
             $this->_mainQuery->andFilterWhere(['user_id' => $this->user_id]);
         }
         if ($this->hasAttribute('type_key')) {
             $this->_mainQuery->andFilterWhere(['type_key' => $this->type_key]);
         }
         if ($this->hasAttribute('app_id')) {
             $this->_mainQuery->andFilterWhere(['app_id' => $this->app_id]);
         }
         if ($this->hasAttribute('model_name')) {
             $this->_mainQuery->andFilterWhere(['like', 'model_name', $this->model_name]);
         }
         if ($this->hasAttribute('model_name')) {
             $this->_mainQuery->andFilterWhere(['like', 'table_name', $this->table_name]);
         }
         if ($this->hasAttribute('created_at')) {
             $this->_mainQuery->andFilterWhere(['like', 'created_at', $this->created_at]);
         }
     }
 }
开发者ID:nazartsev,项目名称:yii2-data-log,代码行数:29,代码来源:DataLogForm.php

示例2: filterAttributes

 /**
  * For filtering attributes
  */
 protected function filterAttributes()
 {
     if ($this->_mainQuery) {
         if ($this->hasAttribute('id')) {
             $this->_mainQuery->andFilterWhere(['id' => $this->id]);
         }
         if ($this->hasAttribute('created_at')) {
             $this->_mainQuery->andFilterWhere(['like', 'created_at', $this->created_at]);
         }
         if ($this->hasAttribute('updated_at')) {
             $this->_mainQuery->andFilterWhere(['like', 'updated_at', $this->updated_at]);
         }
     }
 }
开发者ID:platx,项目名称:yii2-active-record,代码行数:17,代码来源:ActiveRecord.php

示例3: filtersForExtraColumns

 /**
  * @param ActiveQuery $query
  */
 protected function filtersForExtraColumns($query)
 {
     foreach (self::extraColumns() as $attribute) {
         $query->andFilterWhere(['like', self::columnName($attribute, false), $this->getAttribute($attribute)]);
     }
 }
开发者ID:GAMITG,项目名称:yz2-admin,代码行数:9,代码来源:WithExtraColumns.php

示例4: createdAtQueryModifier

 /**
  * Поиск по диапазону дат создания
  * @param \yii\db\ActiveQuery $q
  * @param \common\db\fields\Field $f
  */
 public function createdAtQueryModifier($q, $f)
 {
     $table = $f->model->tableName();
     $attr = $f->attr;
     $toDate = $f->model->createdAtTo ? $f->model->createdAtTo . " 23:59:59" : $f->model->createdAtTo;
     $q->andFilterWhere([">=", "{{%{$table}}}.{{%{$attr}}}", $f->model->createdAtFrom]);
     $q->andFilterWhere(["<=", "{{%{$table}}}.{{%{$attr}}}", $toDate]);
 }
开发者ID:frostiks25,项目名称:rzwebsys7,代码行数:13,代码来源:MetaFields.php

示例5: filterUserId

 /**
  * @param $userId
  * @param ActiveQuery $query
  */
 protected function filterUserId($userId, $query)
 {
     if (strlen($this->user_id)) {
         if (!is_numeric($userId) && ($callback = Audit::getInstance()->userFilterCallback)) {
             $userId = call_user_func($callback, $userId);
         } else {
             $userId = intval($this->user_id) ?: 0;
         }
     }
     $query->andFilterWhere(['user_id' => $userId]);
 }
开发者ID:SaschaScholly,项目名称:yii2-audit,代码行数:15,代码来源:AuditEntrySearch.php

示例6: equal

 public function equal($attribute)
 {
     $this->query->andFilterWhere([$attribute => $this->model->{$attribute}]);
 }
开发者ID:vladdnepr,项目名称:yii2-ycm,代码行数:4,代码来源:SearchQuery.php

示例7: prepareFilters

 /**
  * @param ActiveQuery $query
  */
 protected function prepareFilters($query)
 {
     $query->andFilterWhere(['id' => $this->id, 'is_super_admin' => $this->is_super_admin, 'is_active' => $this->is_active]);
     $query->andFilterWhere(['like', 'login', $this->login])->andFilterWhere(['like', 'passhash', $this->passhash])->andFilterWhere(['like', 'auth_key', $this->auth_key])->andFilterWhere(['like', 'name', $this->name])->andFilterWhere(['like', 'email', $this->email]);
 }
开发者ID:omnilight,项目名称:yz2-admin,代码行数:8,代码来源:UserSearch.php


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