mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 23:22:48 +08:00
Model类的hasWhere方法支持hasone
This commit is contained in:
@@ -1105,6 +1105,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
|
|||||||
$model = new static();
|
$model = new static();
|
||||||
$info = $model->$relation()->getRelationInfo();
|
$info = $model->$relation()->getRelationInfo();
|
||||||
switch ($info['type']) {
|
switch ($info['type']) {
|
||||||
|
case Relation::HAS_ONE:
|
||||||
case Relation::HAS_MANY:
|
case Relation::HAS_MANY:
|
||||||
$table = $info['model']::getTable();
|
$table = $info['model']::getTable();
|
||||||
if (is_array($where)) {
|
if (is_array($where)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user