We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 here.

change table of model

$result = self::find(array(
                'conditions' => "addtime BETWEEN $begin AND $end",
                'columns' => 'optid',
                'group' => 'optid'
// The table of sql is no changed, How can I do it?

I believe that setSource needs to be ran inside of the initialize() method of the model per Andres commentary in this thread:


Nikolaus provides an even more detailed answer here: