This commit is contained in:
as2252258@163.com
2021-05-02 04:50:18 +08:00
parent 77399fa68f
commit 3d8befe6c0
+1 -1
View File
@@ -404,7 +404,7 @@ class ActiveRecord extends BaseActiveRecord
*/ */
public function hasIn($modelName, $foreignKey, $localKey): mixed public function hasIn($modelName, $foreignKey, $localKey): mixed
{ {
if (!$this->has($localKey)) { if (!isset($this->attributes[$localKey])) {
throw new Exception("Need join table primary key."); throw new Exception("Need join table primary key.");
} }