withCount方法的第二个参数默认为true

This commit is contained in:
thinkphp
2016-12-26 15:58:16 +08:00
parent a74b842d71
commit 5128ad407b

View File

@@ -1678,7 +1678,7 @@ class Query
* @param bool $subQuery 是否使用子查询 * @param bool $subQuery 是否使用子查询
* @return $this * @return $this
*/ */
public function withCount($relation, $subQuery = false) public function withCount($relation, $subQuery = true)
{ {
if (!$subQuery) { if (!$subQuery) {
$this->options['with_count'] = $relation; $this->options['with_count'] = $relation;