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


PHP Builder::whereBetween方法代码示例

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


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

示例1: whereBetween

 /**
  * between, 两端开区间
  * @param $attribute
  * @param null $min
  * @param null $max
  * @return static
  */
 public function whereBetween($attribute, $min, $max)
 {
     if ($min > $max) {
         return $this->whereEquals(0, 1);
     }
     $this->original->whereBetween($attribute, [$min, $max]);
     return $this;
 }
开发者ID:zhwei,项目名称:laravel-lego,代码行数:15,代码来源:EloquentTable.php

示例2: _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 'between':
                 $this->operator->whereBetween($field, $val);
                 break;
             case 'raw':
                 $this->operator->whereRaw($val);
                 break;
             default:
                 $this->operator->where($field, $op, $val);
         }
     }
     return $this;
 }
开发者ID:kyleing,项目名称:gtbool,代码行数:35,代码来源:DBOperator.php

示例3: whereBetween

 /**
  * Add a where between statement to the query.
  *
  * @param string $column
  * @param array $values
  * @param string $boolean
  * @param bool $not
  * @return $this 
  * @static 
  */
 public static function whereBetween($column, $values, $boolean = 'and', $not = false)
 {
     return \Illuminate\Database\Query\Builder::whereBetween($column, $values, $boolean, $not);
 }
开发者ID:satriashp,项目名称:tour,代码行数:14,代码来源:_ide_helper.php

示例4: whereBetween

 public function whereBetween($column, array $values, $boolean = 'and', $not = false)
 {
     $column = is_string($column) ? snake_case($column) : $column;
     return parent::whereBetween($column, $values, $boolean, $not);
     // TODO: Change the autogenerated stub
 }
开发者ID:jgraffite,项目名称:snake2camel,代码行数:6,代码来源:QueryBuilder.php


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