public function beforeSave() { if ($this->getIsNewRecord()) { $this->create_time = new CDbExpression('NOW()'); } return parent::beforeSave(); }