addBehavior( new SoftDelete([ 'field' => 'deleted', 'value' => 1, ]) ); } public function beforeCreate() { $this->plan_id = (int)date('Ymd'); $this->create_time = time(); } public function beforeUpdate() { $this->update_time = time(); } public static function roleTypes() { return [ self::ROLE_STUDENT => '学员', self::ROLE_TEACHER => '讲师', ]; } public static function sourceTypes() { return [ self::SOURCE_FREE => '免费', self::SOURCE_CHARGE => '付费', self::SOURCE_VIP => '会员', self::SOURCE_IMPORT => '导入', ]; } }