1.修复后台无法退出的bug

2.更新tp内核
This commit is contained in:
2016-09-12 10:21:09 +08:00
parent 0234fb3d95
commit 1f544d0d59
17 changed files with 274 additions and 213 deletions
+6 -3
View File
@@ -339,7 +339,10 @@ class Relation
{
$foreignKey = $this->foreignKey;
// 预载入关联查询 支持嵌套预载入
$list = $model->where($where)->where($closure)->with($subRelation)->select();
if ($closure) {
call_user_func_array($closure, [ & $model]);
}
$list = $model->where($where)->with($subRelation)->select();
// 组装模型数据
$data = [];
@@ -602,7 +605,7 @@ class Relation
// 保存关联表数据
$model = new $this->model;
$id = $model->save($data);
} elseif (is_numeric($data)) {
} elseif (is_numeric($data) || is_string($data)) {
// 根据关联表主键直接写入中间表
$id = $data;
} elseif ($data instanceof Model) {
@@ -634,7 +637,7 @@ class Relation
{
if (is_array($data)) {
$id = $data;
} elseif (is_numeric($data)) {
} elseif (is_numeric($data) || is_string($data)) {
// 根据关联表主键直接写入中间表
$id = $data;
} elseif ($data instanceof Model) {