當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。