本文整理汇总了PHP中Illuminate\Database\Query\Builder::orWhereRaw方法的典型用法代码示例。如果您正苦于以下问题:PHP Builder::orWhereRaw方法的具体用法?PHP Builder::orWhereRaw怎么用?PHP Builder::orWhereRaw使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Database\Query\Builder
的用法示例。
在下文中一共展示了Builder::orWhereRaw方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fetchSelectedItems
public function fetchSelectedItems(QueryBuilder $builder)
{
$self = $this;
$this->filters->items[] = -1;
//faço a busca de acordo com a palavra pesquisada, caso tenha uma:
if ($this->filters->searchString) {
if (count($this->filters->columns) > 0) {
$builder->where(function ($q) use($self, $builder) {
foreach ($this->filters->columns as $column) {
if (!$column->bSearchable) {
continue;
}
$builder->orWhereRaw($column->name . " LIKE '%" . $self->filters->searchString . "%'");
}
});
}
}
if ($this->filters->checkedAll == 1) {
$builder->whereNotIn($this->filters->idField, $this->filters->items);
return $builder;
}
$builder->whereIn($this->filters->idField, $this->filters->items);
return $builder;
}
示例2: orWhereRaw
/**
* Add a raw or where clause to the query.
*
* @param string $sql
* @param array $bindings
* @return \Illuminate\Database\Query\Builder|static
* @static
*/
public static function orWhereRaw($sql, $bindings = array())
{
return \Illuminate\Database\Query\Builder::orWhereRaw($sql, $bindings);
}