当前位置: 首页>>代码示例>>PHP>>正文


PHP Builder::whereDoesntHave方法代码示例

本文整理汇总了PHP中Illuminate\Database\Eloquent\Builder::whereDoesntHave方法的典型用法代码示例。如果您正苦于以下问题:PHP Builder::whereDoesntHave方法的具体用法?PHP Builder::whereDoesntHave怎么用?PHP Builder::whereDoesntHave使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Illuminate\Database\Eloquent\Builder的用法示例。


在下文中一共展示了Builder::whereDoesntHave方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: whereDoesntHave

 /**
  * Add a relationship count condition to the query with where clauses.
  *
  * @param string $relation
  * @param \Closure|null $callback
  * @return \Illuminate\Database\Eloquent\Builder|static 
  * @static 
  */
 public static function whereDoesntHave($relation, $callback = null)
 {
     return \Illuminate\Database\Eloquent\Builder::whereDoesntHave($relation, $callback);
 }
开发者ID:satriashp,项目名称:tour,代码行数:12,代码来源:_ide_helper.php

示例2: scopeNotTranslatedIn

 /**
  * @param \Illuminate\Database\Eloquent\Builder $query
  * @param string                                $locale
  *
  * @return \Illuminate\Database\Eloquent\Builder|static
  */
 public function scopeNotTranslatedIn(Builder $query, $locale = null)
 {
     $locale = $locale ?: $this->locale();
     return $query->whereDoesntHave('translations', function (Builder $q) use($locale) {
         $q->where($this->getLocaleKey(), '=', $locale);
     });
 }
开发者ID:dimsav,项目名称:laravel-translatable,代码行数:13,代码来源:Translatable.php

示例3: scopeWithoutTag

 /**
  * {@inheritdoc}
  */
 public static function scopeWithoutTag(Builder $query, $tags, $type = 'slug')
 {
     $tags = (new static())->prepareTags($tags);
     return $query->whereDoesntHave('tags', function ($query) use($type, $tags) {
         $query->whereIn($type, $tags);
     });
 }
开发者ID:cartalyst,项目名称:tags,代码行数:10,代码来源:TaggableTrait.php

示例4: scopeDoesntHaveActiveDiary

 /**
  * アクティブな日誌がないか
  * @param Builder $query
  * @return Builder|static
  */
 public function scopeDoesntHaveActiveDiary(Builder $query)
 {
     return $query->whereDoesntHave('workDiaries', function ($query) {
         $query->where('archive', false);
     });
 }
开发者ID:nana4rider,项目名称:mdiary,代码行数:11,代码来源:WorkField.php

示例5: scopeWithoutActivePlayers

 /**
  * Groups with no players for a given season.
  */
 public function scopeWithoutActivePlayers(Builder $query, Season $season)
 {
     return $query->whereDoesntHave('players', function (Builder $q) use($season) {
         $q->active($season);
     });
 }
开发者ID:BibleBowl,项目名称:account,代码行数:9,代码来源:Group.php

示例6: scopeWithoutAttach

 /**
  * {@inheritdoc}
  */
 public static function scopeWithoutAttach(Builder $query, $attaches, $type = 'filename')
 {
     $attaches = (new static())->prepareAttaches($attaches);
     return $query->whereDoesntHave('attaches', function ($query) use($type, $attaches) {
         $query->whereIn($type, $attaches);
     });
 }
开发者ID:AngryDeer,项目名称:Attachfiles,代码行数:10,代码来源:AttachableTrait.php

示例7: scopeActive

 /**
  * @param Builder $query
  *
  * @return Builder
  */
 public function scopeActive(Builder $query)
 {
     return $query->whereDoesntHave('order');
 }
开发者ID:hughgrigg,项目名称:ching-shop,代码行数:9,代码来源:Basket.php

示例8: scopeNotOnTeamSet

 public function scopeNotOnTeamSet(Builder $query, TeamSet $teamSet)
 {
     return $query->whereDoesntHave('teams', function (Builder $query) use($teamSet) {
         $query->where('teams.team_set_id', $teamSet->id);
     });
 }
开发者ID:BibleBowl,项目名称:account,代码行数:6,代码来源:Player.php


注:本文中的Illuminate\Database\Eloquent\Builder::whereDoesntHave方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。