tp框架更新

This commit is contained in:
devil_gong
2019-11-13 11:54:57 +08:00
parent 7165bc29ce
commit 96c384491e
54 changed files with 336 additions and 843 deletions

View File

@ -11,7 +11,6 @@
namespace think\model\relation;
use Closure;
use think\db\Query;
use think\Exception;
use think\Loader;
@ -88,7 +87,7 @@ abstract class OneToOne extends Relation
$joinOn = $name . '.' . $this->localKey . '=' . $joinAlias . '.' . $this->foreignKey;
}
if ($closure instanceof Closure) {
if ($closure) {
// 执行闭包查询
$closure($query);
// 使用withField指定获取关联的字段
@ -312,7 +311,7 @@ abstract class OneToOne extends Relation
protected function eagerlyWhere($where, $key, $relation, $subRelation = '', $closure = null)
{
// 预载入关联查询 支持嵌套预载入
if ($closure instanceof Closure) {
if ($closure) {
$closure($this->query);
if ($field = $this->query->getOptions('with_field')) {