當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Builder::leftJoin方法代碼示例

本文整理匯總了PHP中Illuminate\Database\Query\Builder::leftJoin方法的典型用法代碼示例。如果您正苦於以下問題:PHP Builder::leftJoin方法的具體用法?PHP Builder::leftJoin怎麽用?PHP Builder::leftJoin使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Illuminate\Database\Query\Builder的用法示例。


在下文中一共展示了Builder::leftJoin方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: leftJoinOn

 /**
  * @param $table
  * @param $key $table.key
  * @param bool $fkey $this->table.key
  * @return $this
  */
 public function leftJoinOn($table, $key, $fkey = false)
 {
     $fkey = $fkey ?: $key;
     $key = starts_with($key, $table . '.') ? $key : $table . '.' . $key;
     $fkey = starts_with($key, $this->table . '.') ? $fkey : $this->table . '.' . $fkey;
     $this->operator = $this->operator->leftJoin($table, $key, '=', $fkey);
     return $this;
 }
開發者ID:kyleing,項目名稱:gtbool,代碼行數:14,代碼來源:DBOperator.php

示例2: leftJoin

 /**
  * Add a left join to the query.
  *
  * @param string $table
  * @param string $first
  * @param string $operator
  * @param string $second
  * @return \Illuminate\Database\Query\Builder|static 
  * @static 
  */
 public static function leftJoin($table, $first, $operator = null, $second = null)
 {
     return \Illuminate\Database\Query\Builder::leftJoin($table, $first, $operator, $second);
 }
開發者ID:satriashp,項目名稱:tour,代碼行數:14,代碼來源:_ide_helper.php

示例3: scopeWithAuthor

 /**
  * @param \Illuminate\Database\Query\Builder $query
  * @return \Illuminate\Database\Query\Builder
  */
 public function scopeWithAuthor($query)
 {
     return $query->leftJoin('users', 'users.id', '=', "{$this->table}.user_id")->addSelect("users.username as author");
 }
開發者ID:minhbang,項目名稱:laravel-simple-user,代碼行數:8,代碼來源:UserQuery.php

示例4: scopeWithUser

 /**
  * Load thông tin user
  *
  * @param \Illuminate\Database\Query\Builder $query
  *
  * @return \Illuminate\Database\Query\Builder|static
  */
 public function scopeWithUser($query)
 {
     $query->leftJoin('users', "{$this->table}.user_id", '=', "users.id")->addSelect('users.name as user_name', 'users.username as user_username');
     return $query;
 }
開發者ID:minhbang,項目名稱:laravel-ilib,代碼行數:12,代碼來源:Reader.php

示例5: joinRevision

 /**
  * $query 에 join 된 쿼리를 리턴
  *
  * @param Builder $query query builder
  * @return Builder
  */
 public function joinRevision(Builder $query)
 {
     $config = $this->config;
     $tableName = $query->from;
     $table = $this->handler->getConfigHandler()->getRevisionTableName($config);
     $query->leftJoin($table, function (JoinClause $join) use($tableName, $table, $config) {
         $join->on(sprintf('%s.%s', $tableName, $config->get('joinColumnName')), '=', sprintf('%s.dynamicFieldTargetId', $table))->on(sprintf('%s.revisionId', $tableName), '=', sprintf('%s.revisionId', $table));
     });
     return $query;
 }
開發者ID:qkrcjfgus33,項目名稱:xpressengine,代碼行數:16,代碼來源:AbstractType.php


注:本文中的Illuminate\Database\Query\Builder::leftJoin方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。