这样会乱套的吧... 就像之前gini框架里面的$this->form()和$this->form弄得混淆了
这个里面把fields和table传出来的目的就是为了后面生成sum_SQL吗? 
另外这里面$query->SQL和$query->count_SQL是完整的, 但是$query->sum_SQL就是局部的是吗?
感觉上命名容易混乱啊, 而且这里面引入新的table, sum_SQL和fields 仅仅就为了sum()一个来服务
有没有什么更直接的手段?

On May 4, 2014, at 9:25 PM, Rui Ma <notifications@github.com> wrote:

> In libraries/q/query.php:
> 
> >              $this->SQL = 'SELECT '.$fields.' FROM '.$SQL;
> > -			$this->count_SQL = 'SELECT COUNT(DISTINCT '.$db->make_ident($this->table, 'id').') count FROM ' . $count_SQL;
> > -
> > +            $this->count_SQL = 'SELECT COUNT(DISTINCT '.$db->make_ident($this->table, 'id').') count FROM '. $count_SQL;
> > +            $this->sum_SQL = $sum_SQL;
> > +            $this->fields = $this->fields($this->name);
> 可以啊，php中变量名和函数可以相同，如下我简单进行测试： <?php class A { public $foo; public function __construct() { $this->foo = 'foo'; } public function foo() { echo 'bar'; } } $a = new A(); echo $a->foo; $a->foo(); 是没有问题的。
> …
> —
> Reply to this email directly or view it on GitHub.
>