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


PHP unknown::where方法代码示例

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


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

示例1: scopeCustomer

 /**
  * Named scope for customer users
  * @param unknown $query
  */
 public function scopeCustomer($query)
 {
     $query->leftJoin('user_to_role', 'user.id', '=', 'user_to_role.user_id');
     $query->leftJoin('role', 'role.id', '=', 'user_to_role.role_id');
     $query->groupBy('user.id');
     return $query->where('role.value', '=', 'role_customer');
 }
开发者ID:atudz,项目名称:gorabelframework,代码行数:11,代码来源:User.php

示例2: scopePopular

 /**
  *
  * @param unknown $query
  */
 public function scopePopular($query)
 {
     return $query->where('votes', '>', 100);
 }
开发者ID:khoale193,项目名称:lavarel,代码行数:8,代码来源:Invitation.php

示例3: scopeCustomer

 /**
  * Named scope for customer category
  * @param unknown $query
  */
 public function scopeCustomer($query)
 {
     return $query->where('permission.category', '=', 'customer');
 }
开发者ID:atudz,项目名称:gorabelframework,代码行数:8,代码来源:Permission.php

示例4: scopeCustom

 /**
  * Named scope for geting custom features only
  * @param unknown $query
  */
 public function scopeCustom($query)
 {
     return $query->where('system', '=', 0);
 }
开发者ID:atudz,项目名称:gorabelframework,代码行数:8,代码来源:Feature.php

示例5: scopeAdmin

 /**
  * Query scope for filtering admin users
  * @param unknown $query
  */
 public function scopeAdmin($query)
 {
     $id = \DB::table('user_group')->where(['name' => 'admin'])->value('id');
     return $query->where('user_group_pk_id', '=', $id);
 }
开发者ID:atudz,项目名称:SFAReport,代码行数:9,代码来源:User.php

示例6: scopeUser

 /**
  * Query scope for filtering admins
  * @param unknown $query
  */
 public function scopeUser($query)
 {
     return $query->where('name', '=', 'user');
 }
开发者ID:atudz,项目名称:SFAReport,代码行数:8,代码来源:UserGroup.php

示例7: setFilters

 /**
  * Method for the create where commands for filter function
  *
  * @param unknown $query
  * @param unknown $db
  * @return string where command for audiotrack list filtering
  */
 public function setFilters($query, $db)
 {
     $app = JFactory::getApplication();
     $user = JFactory::getUser();
     // Filter by Artist / Band.
     if ($artist = $app->getUserStateFromRequest('filter.artist', 'filter_artist')) {
         $query->where('a.artist = "' . $db->escape($artist) . '"');
     }
     // Filter by Category.
     if ($category_id = $app->getUserStateFromRequest('filter.category_id', 'filter_category_id')) {
         $query->where('a.catid = ' . (int) $category_id);
     }
     // Filter by Category.
     if ($access_id = $app->getUserStateFromRequest('filter.access_id', 'filter_access_id')) {
         $query->where('a.access = ' . (int) $access_id);
     }
     // Filter by User.
     if ($user_id = $app->getUserStateFromRequest('filter.user_id', 'filter_user_id')) {
         $query->where('a.add_by = ' . (int) $user_id);
     }
     // Filter by Album.
     if ($album = $app->getUserStateFromRequest('filter.album', 'filter_album')) {
         $query->where('a.album = "' . $db->escape($album) . '"');
     }
     // Filter by Year.
     if ($year = $app->getUserStateFromRequest('filter.year', 'filter_year')) {
         $query->where('a.year = ' . (int) $year);
     }
     // Filter by User.
     if (JAccess::check($user->get('id'), 'core.admin') != 1) {
         $query->where('a.add_by = ' . $user->get('id'));
     }
     return $query;
 }
开发者ID:TFToto,项目名称:playjoom-builds,代码行数:41,代码来源:audiotracks.php

示例8: scopePrimary

 /**
  * Query scope for filtering prirmary contact number
  * @param unknown $query
  */
 public function scopePrimary($query)
 {
     return $query->where('primary', '=', '1');
 }
开发者ID:atudz,项目名称:SFAReport,代码行数:8,代码来源:UserPhone.php

示例9: scopeProtected

 /**
  * Named scope for protected navs
  * @param unknown $query
  */
 public function scopeProtected($query)
 {
     return $query->where('navigation.protected', '=', 1);
 }
开发者ID:atudz,项目名称:gorabelframework,代码行数:8,代码来源:Navigation.php

示例10: scopeActive

 /**
  * Chỉ hiện thị các bài viết (Article) đã lựa chọn cho phép hiển thị
  * 
  * @param unknown $query
  */
 public function scopeActive($query)
 {
     $query->where('status', 1);
 }
开发者ID:khanhpnk,项目名称:hocvet,代码行数:9,代码来源:Article.php

示例11: scopeInactive

 /**
  * Named scope for geting inactive roles only
  * @param unknown $query
  */
 public function scopeInactive($query)
 {
     return $query->where('active', '=', 0);
 }
开发者ID:atudz,项目名称:gorabelframework,代码行数:8,代码来源:Role.php


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