本文整理匯總了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);
}