mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 23:22:48 +08:00
改进Model类has和hasWhere方法
This commit is contained in:
@@ -1144,8 +1144,9 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
|
|||||||
->join($table . ' b', 'a.' . $info['localKey'] . '=b.' . $info['foreignKey'], $info['joinType'])
|
->join($table . ' b', 'a.' . $info['localKey'] . '=b.' . $info['foreignKey'], $info['joinType'])
|
||||||
->group('b.' . $info['foreignKey'])
|
->group('b.' . $info['foreignKey'])
|
||||||
->having('count(' . $id . ')' . $operator . $count);
|
->having('count(' . $id . ')' . $operator . $count);
|
||||||
case Relation::HAS_MANY_THROUGH:
|
case Relation::HAS_MANY_THROUGH: // TODO
|
||||||
// TODO
|
default:
|
||||||
|
return $model;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1176,8 +1177,9 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
|
|||||||
->field('a.*')
|
->field('a.*')
|
||||||
->join($table . ' b', 'a.' . $info['localKey'] . '=b.' . $info['foreignKey'], $info['joinType'])
|
->join($table . ' b', 'a.' . $info['localKey'] . '=b.' . $info['foreignKey'], $info['joinType'])
|
||||||
->where($where);
|
->where($where);
|
||||||
case Relation::HAS_MANY_THROUGH:
|
case Relation::HAS_MANY_THROUGH: // TODO
|
||||||
// TODO
|
default:
|
||||||
|
return $model;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user