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 => '导入', self::SOURCE_POINT_REDEEM => '积分兑换', self::SOURCE_LUCKY_REDEEM => '抽奖兑换', ]; } }