This commit is contained in:
xl
2024-11-06 21:06:01 +08:00
parent 59c9a2e944
commit 4e59053d5c
7 changed files with 20 additions and 10 deletions
+2 -2
View File
@@ -278,7 +278,7 @@ class Model extends Base\Model
throw new Exception("Need join table primary key.");
}
$relation = $this->getRelation();
$relation = di(Relation::class);
$primaryKey = str_replace('\\\\', '_', $modelName) . '_' . $foreignKey . '_' . $value;
if (!$relation->hasIdentification($primaryKey)) {
@@ -339,7 +339,7 @@ class Model extends Base\Model
throw new Exception("Need join table primary key.");
}
$relation = $this->getRelation();
$relation = di(Relation::class);
$primaryKey = str_replace('\\\\', '_', $modelName) . '_' . $foreignKey . '_' . implode('_', $value);
if (!$relation->hasIdentification($primaryKey)) {