mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-06 23:02:48 +08:00
改进中间表模型的实例化
This commit is contained in:
@@ -2361,8 +2361,8 @@ class Query
|
|||||||
if (count($resultSet) > 0) {
|
if (count($resultSet) > 0) {
|
||||||
foreach ($resultSet as $key => $result) {
|
foreach ($resultSet as $key => $result) {
|
||||||
/** @var Model $model */
|
/** @var Model $model */
|
||||||
$model = new $modelName($result);
|
$model = new $modelName();
|
||||||
$model->isUpdate(true);
|
$model->data($result)->isUpdate(true);
|
||||||
|
|
||||||
// 关联查询
|
// 关联查询
|
||||||
if (!empty($options['relation'])) {
|
if (!empty($options['relation'])) {
|
||||||
@@ -2518,8 +2518,8 @@ class Query
|
|||||||
if (!empty($this->model)) {
|
if (!empty($this->model)) {
|
||||||
// 返回模型对象
|
// 返回模型对象
|
||||||
$model = $this->model;
|
$model = $this->model;
|
||||||
$result = new $model($result);
|
$result = new $model();
|
||||||
$result->isUpdate(true, isset($options['where']['AND']) ? $options['where']['AND'] : null);
|
$result->data($result)->isUpdate(true, isset($options['where']['AND']) ? $options['where']['AND'] : null);
|
||||||
// 关联查询
|
// 关联查询
|
||||||
if (!empty($options['relation'])) {
|
if (!empty($options['relation'])) {
|
||||||
$result->relationQuery($options['relation']);
|
$result->relationQuery($options['relation']);
|
||||||
|
|||||||
Reference in New Issue
Block a user