更新tp5内核

This commit is contained in:
2018-01-02 23:03:31 +08:00
parent 590696a06b
commit 3818619504
99 changed files with 3362 additions and 2006 deletions
+14 -11
View File
@@ -2,7 +2,7 @@
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved.
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
@@ -78,9 +78,9 @@ abstract class OneToOne extends Relation
$query->via($joinAlias);
if ($this instanceof BelongsTo) {
$query->join($joinTable . ' ' . $joinAlias, $alias . '.' . $this->foreignKey . '=' . $joinAlias . '.' . $this->localKey, $this->joinType);
$query->join([$joinTable => $joinAlias], $alias . '.' . $this->foreignKey . '=' . $joinAlias . '.' . $this->localKey, $this->joinType);
} else {
$query->join($joinTable . ' ' . $joinAlias, $alias . '.' . $this->localKey . '=' . $joinAlias . '.' . $this->foreignKey, $this->joinType);
$query->join([$joinTable => $joinAlias], $alias . '.' . $this->localKey . '=' . $joinAlias . '.' . $this->foreignKey, $this->joinType);
}
if ($closure) {
@@ -214,6 +214,16 @@ abstract class OneToOne extends Relation
return $this;
}
/**
* 获取绑定属性
* @access public
* @return array
*/
public function getBindAttr()
{
return $this->bindAttr;
}
/**
* 关联统计
* @access public
@@ -276,7 +286,7 @@ abstract class OneToOne extends Relation
if (isset($result->$key)) {
throw new Exception('bind attr has exists:' . $key);
} else {
$result->setAttr($key, $model->$attr);
$result->setAttr($key, $model ? $model->$attr : null);
}
}
}
@@ -311,11 +321,4 @@ abstract class OneToOne extends Relation
return $data;
}
/**
* 执行基础查询(进执行一次)
* @access protected
* @return void
*/
protected function baseQuery()
{}
}