本文整理汇总了PHP中Eloquent::whereBetween方法的典型用法代码示例。如果您正苦于以下问题:PHP Eloquent::whereBetween方法的具体用法?PHP Eloquent::whereBetween怎么用?PHP Eloquent::whereBetween使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Eloquent
的用法示例。
在下文中一共展示了Eloquent::whereBetween方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addFilterRangeNumericSlider
/**
* Фильтр: диапазон чисел
*
* @param $form_field
* @param $label
* @param null $db_field
*/
function addFilterRangeNumericSlider($form_field, $label, $min = null, $max = null, $db_field = null)
{
if (!$db_field) {
$db_field = $form_field;
}
larastatic('bootstrap-slider');
$value = \Input::get($form_field, $min . ',' . $max);
$el = $this->form->putTbSlider($form_field)->setLabel($label)->setValue($value)->setOptionMax($max)->setOptionMin($min);
$gr = $this->form->putTbGroup()->setAttribute('rel', $el->getId())->addClass('js-slider-group');
$from_name = 'from_' . $form_field;
$to_name = 'to_' . $form_field;
$gr->putTbInt($from_name)->setWrapClass('col-md-6')->addClass('js-slider-min');
$gr->putTbInt($to_name)->setWrapClass('col-md-6')->addClass('js-slider-max');
$values = explode(',', $value);
$this->form->initValues([$from_name => Arr::get($values, 0), $to_name => Arr::get($values, 1)]);
\LaraJs::addInline('');
$value = \Input::get($form_field);
if ($value) {
$values = explode(',', $value);
$values = $this->ids($values);
$this->model->whereBetween($db_field, $values);
}
}