mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 12:42:48 +08:00
model类的setField方法忽略数据副本
This commit is contained in:
@@ -680,6 +680,8 @@ class Model
|
|||||||
} else {
|
} else {
|
||||||
$data[$field] = $value;
|
$data[$field] = $value;
|
||||||
}
|
}
|
||||||
|
// 更新某个字段的时候 忽略数据副本
|
||||||
|
$this->duplicate = [];
|
||||||
return $this->save($data);
|
return $this->save($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -709,7 +711,6 @@ class Model
|
|||||||
$step = '-' . $step;
|
$step = '-' . $step;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->duplicate = [];
|
|
||||||
return $this->setField($field, ['exp', $field . '+' . $step]);
|
return $this->setField($field, ['exp', $field . '+' . $step]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -739,7 +740,6 @@ class Model
|
|||||||
$step = '-' . $step;
|
$step = '-' . $step;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->duplicate = [];
|
|
||||||
return $this->setField($field, ['exp', $field . '-' . $step]);
|
return $this->setField($field, ['exp', $field . '-' . $step]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -145,13 +145,13 @@ class View
|
|||||||
*
|
*
|
||||||
* @param string $template 模板文件名或者内容
|
* @param string $template 模板文件名或者内容
|
||||||
* @param array $vars 模板输出变量
|
* @param array $vars 模板输出变量
|
||||||
* @param array $cache 模板缓存参数
|
* @param array $config 模板参数
|
||||||
* @param bool $renderContent 是否渲染内容
|
* @param bool $renderContent 是否渲染内容
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function fetch($template = '', $vars = [], $cache = [], $renderContent = false)
|
public function fetch($template = '', $vars = [], $config = [], $renderContent = false)
|
||||||
{
|
{
|
||||||
// 模板变量
|
// 模板变量
|
||||||
$vars = $vars ? $vars : $this->data;
|
$vars = $vars ? $vars : $this->data;
|
||||||
@@ -175,7 +175,7 @@ class View
|
|||||||
is_file($template) ? include $template : eval('?>' . $template);
|
is_file($template) ? include $template : eval('?>' . $template);
|
||||||
} else {
|
} else {
|
||||||
// 指定模板引擎
|
// 指定模板引擎
|
||||||
$this->engine->fetch($template, $vars, $cache);
|
$this->engine->fetch($template, $vars, $config);
|
||||||
}
|
}
|
||||||
// 获取并清空缓存
|
// 获取并清空缓存
|
||||||
$content = ob_get_clean();
|
$content = ob_get_clean();
|
||||||
|
|||||||
Reference in New Issue
Block a user