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


PHP Builder::whereNotNull方法代码示例

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


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

示例1: addWhere

 /**
  * Add a "where" clause to the given query.
  *
  * @param  \Illuminate\Database\Query\Builder $query
  * @param  string $key
  * @param  string $extraValue
  * @return void
  */
 protected function addWhere($query, $key, $extraValue)
 {
     if ($extraValue === 'NULL') {
         $query->whereNull($key);
     } elseif ($extraValue === 'NOT_NULL') {
         $query->whereNotNull($key);
     } else {
         $query->where($key, $extraValue);
     }
 }
开发者ID:scrobot,项目名称:Lumen,代码行数:18,代码来源:DatabasePresenceVerifier.php

示例2: addWhere

 /**
  * Add a "where" clause to the given query.
  *
  * @param \Illuminate\Database\Query\Builder $query        	
  * @param string $key        	
  * @param string $extraValue        	
  * @return void
  */
 protected function addWhere($query, $key, $extraValue)
 {
     if ($extraValue === 'NULL') {
         $query->whereNull($key);
     } elseif ($extraValue === 'NOT_NULL') {
         $query->whereNotNull($key);
     } elseif (Str::startsWith($extraValue, '!')) {
         $query->where($key, '!=', mb_substr($extraValue, 1));
     } else {
         $query->where($key, $extraValue);
     }
 }
开发者ID:sapwoo,项目名称:portfolio,代码行数:20,代码来源:DatabasePresenceVerifier.php

示例3: _wheres

 /**
  * like wheres function ,call by internal
  * @param array $conds
  * @return $this
  */
 protected function _wheres($conds)
 {
     foreach ($conds as $field => $opAndVal) {
         if (is_null($opAndVal)) {
             $opAndVal = [null];
         }
         $opAndVal = (array) $opAndVal;
         $op = strtolower(count($opAndVal) == 1 ? '=' : $opAndVal[0]);
         $val = last($opAndVal);
         $field = str_contains($field, '.') ? $field : $this->_table . '.' . $field;
         switch ($op) {
             case 'in':
                 if (count($val) == 1) {
                     $this->_operator->where($field, '=', $val[0]);
                 } else {
                     $this->_operator->whereIn($field, $val);
                 }
                 break;
             case 'notin':
                 if (count($val) == 1) {
                     $this->_operator->where($field, '<>', $val[0]);
                 } else {
                     $this->_operator->whereNotIn($field, $val);
                 }
                 break;
             case 'between':
                 $this->_operator->whereBetween($field, $val);
                 break;
             case 'notbetween':
                 $this->_operator->whereNotBetween($field, $val);
                 break;
             case 'null':
                 if ($val) {
                     $this->_operator->whereNull($field);
                 } else {
                     $this->_operator->whereNotNull($field);
                 }
                 break;
             case 'raw':
                 $this->_operator->whereRaw($val);
                 break;
             default:
                 $this->_operator->where($field, $op, $val);
         }
     }
     return $this;
 }
开发者ID:kyleing,项目名称:laravel-tool,代码行数:52,代码来源:DBOperator.php

示例4: whereNotNull

 /**
  * Add a "where not null" clause to the query.
  *
  * @param string $column
  * @param string $boolean
  * @return \Illuminate\Database\Query\Builder|static 
  * @static 
  */
 public static function whereNotNull($column, $boolean = 'and')
 {
     return \Illuminate\Database\Query\Builder::whereNotNull($column, $boolean);
 }
开发者ID:satriashp,项目名称:tour,代码行数:12,代码来源:_ide_helper.php

示例5: onlyTrashed

 /**
  * Force the result set to only included soft deletes.
  *
  * @return \Illuminate\Database\Eloquent\Builder|static
  */
 public function onlyTrashed()
 {
     $this->withTrashed();
     $this->query->whereNotNull($this->model->getQualifiedDeletedAtColumn());
     return $this;
 }
开发者ID:aysenli,项目名称:laravel-admin-1,代码行数:11,代码来源:Builder.php

示例6: addWhereQuery

 /**
  * Add where to query builder
  * @param \Illuminate\Database\Query\Builder $query
  * @param array $subentity = null only add wheres with this subeneity
  */
 protected function addWhereQuery($query, $subentity = null)
 {
     // Ex with both filter and where: select * from `dms` where (`key` like ? or `name` like ?) and `disabled` = ?
     if (isset($this->where)) {
         foreach ($this->where as $where) {
             #$table = $where['table'];
             $column = $where['column'];
             $operator = $where['operator'];
             $value = $where['value'];
             if ($operator == 'in') {
                 #$query->whereIn("$table.$column", $value);
                 $query->whereIn($column, $value);
             } elseif ($operator == 'null') {
                 if ($value) {
                     $query->whereNull($column);
                 } else {
                     $query->whereNotNull($column);
                 }
             } else {
                 #$query->where("$table.$column", $operator, $value);
                 $query->where($column, $operator, $value);
             }
         }
     }
 }
开发者ID:mreschke,项目名称:repository,代码行数:30,代码来源:DbStore.php

示例7: scopeOnlyPublished

 /**
  * Query scope for only published data.
  *
  * @param \Illuminate\Database\Query\Builder $query
  *
  * @return \Illuminate\Database\Query\Builder
  */
 public function scopeOnlyPublished($query)
 {
     return $query->whereNotNull(self::PUBLISHED_AT);
 }
开发者ID:aguaragazu,项目名称:LaravelStart,代码行数:11,代码来源:Publishable.php


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