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