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