改进Model类has和hasWhere方法

This commit is contained in:
thinkphp
2016-10-11 12:27:22 +08:00
parent 6440a640cd
commit 5ff97ce68d

View File

@@ -1144,8 +1144,9 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
->join($table . ' b', 'a.' . $info['localKey'] . '=b.' . $info['foreignKey'], $info['joinType'])
->group('b.' . $info['foreignKey'])
->having('count(' . $id . ')' . $operator . $count);
case Relation::HAS_MANY_THROUGH:
// TODO
case Relation::HAS_MANY_THROUGH: // TODO
default:
return $model;
}
}
@@ -1176,8 +1177,9 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
->field('a.*')
->join($table . ' b', 'a.' . $info['localKey'] . '=b.' . $info['foreignKey'], $info['joinType'])
->where($where);
case Relation::HAS_MANY_THROUGH:
// TODO
case Relation::HAS_MANY_THROUGH: // TODO
default:
return $model;
}
}