变更
This commit is contained in:
+1
-1
@@ -676,7 +676,7 @@ abstract class Model extends Component implements ModelInterface, ArrayAccess, T
|
|||||||
* @param $name
|
* @param $name
|
||||||
* @return mixed|null
|
* @return mixed|null
|
||||||
*/
|
*/
|
||||||
private function withRelate($name): mixed
|
protected function withRelate($name): mixed
|
||||||
{
|
{
|
||||||
$response = $this->{'get' . ucfirst($name)}();
|
$response = $this->{'get' . ucfirst($name)}();
|
||||||
if ($response instanceof HasBase) {
|
if ($response instanceof HasBase) {
|
||||||
|
|||||||
@@ -274,10 +274,7 @@ class Model extends Base\Model
|
|||||||
{
|
{
|
||||||
$with = $this->getWith();
|
$with = $this->getWith();
|
||||||
foreach ($with as $value) {
|
foreach ($with as $value) {
|
||||||
$join = $this->{'get' . ucfirst($value)}();
|
$join = $this->withRelate($value);
|
||||||
if ($join instanceof HasBase) {
|
|
||||||
$join = $join->get();
|
|
||||||
}
|
|
||||||
if ($join instanceof Kiri\ToArray) {
|
if ($join instanceof Kiri\ToArray) {
|
||||||
$join = $join->toArray();
|
$join = $join->toArray();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user