From a7d8ee83ee8d2caf3ce66e177f67a83624aa4ccc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Mon, 10 Apr 2023 17:39:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Model.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Model.php b/Model.php index 66b7484..a5e796d 100644 --- a/Model.php +++ b/Model.php @@ -261,7 +261,16 @@ class Model extends Base\Model } $data[$key] = $this->{$method}($datum); } + return $this->withs($data); + } + + /** + * @param $data + * @return array + */ + private function withs($data): array + { $with = $this->getWith(); foreach ($with as $value) { $join = $this->{'get' . ucfirst($value)}();