mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-05 22:52:49 +08:00
改进Model类的db方法 并增加query属性
This commit is contained in:
@@ -593,7 +593,7 @@ class Relation
|
||||
{
|
||||
if ($this->model) {
|
||||
$model = new $this->model;
|
||||
$db = $model::db();
|
||||
$db = $model->db();
|
||||
if (self::HAS_MANY == $this->type && isset($this->parent->{$this->localKey})) {
|
||||
// 关联查询带入关联条件
|
||||
$db->where($this->foreignKey, $this->parent->{$this->localKey});
|
||||
|
||||
Reference in New Issue
Block a user