本文整理汇总了PHP中Illuminate\Database\Eloquent\Model::whereNotIn方法的典型用法代码示例。如果您正苦于以下问题:PHP Model::whereNotIn方法的具体用法?PHP Model::whereNotIn怎么用?PHP Model::whereNotIn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Database\Eloquent\Model
的用法示例。
在下文中一共展示了Model::whereNotIn方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: findWhereNotIn
/**
* Find data by excluding multiple values in one field
*
* @param $field
* @param array $values
* @param array $columns
*
* @return mixed
*/
public function findWhereNotIn($field, array $values, $columns = ['*'])
{
$this->applyCriteria();
$model = $this->model->whereNotIn($field, $values)->get($columns);
$this->resetModel();
return $this->parserResult($model);
}
示例2: whereNotIn
/**
* Add whereNotIn condition for next query.
*
* @param string $column
* @param array $value
*
* @return void
*/
public function whereNotIn($column, array $value)
{
$this->model = $this->model->whereNotIn($column, $value);
return $this;
}
示例3: availableCountries
/**
* @return mixed
* Get
* @todo : Cache the Query
*/
public function availableCountries()
{
$selectedCountry = Session::has('user.country') ? Session::get('user.country') : null;
$query = $this->model->whereNotIn('iso_code', [$selectedCountry])->get();
return $query;
}
示例4: whereNotIn
/**
* Find data by excluding multiple values in one field
*
* @param $field
* @param array $values
*
* @return mixed
*/
public function whereNotIn($field, array $values)
{
$this->applyCriteria();
$this->model = $this->model->whereNotIn($field, $values);
return $this;
}
示例5: scopeWhereNotInSubQuery
/**
* @param EloquentBuilder|QueryBuilder|Model $query
* @param string $column
* @param QueryBuilder $subQuery
* @param string $subQueryColumn
*
* @return QueryBuilder
*/
public function scopeWhereNotInSubQuery($query, $column, $subQuery, $subQueryColumn)
{
$subQuery = $subQuery->toSubQuery($subQueryColumn, true);
return $query->whereNotIn($column, $subQuery);
}