diff --git a/src/cpp/controller/User.cpp b/src/cpp/controller/User.cpp index 4437e5c9e..d728e9d2b 100644 --- a/src/cpp/controller/User.cpp +++ b/src/cpp/controller/User.cpp @@ -274,7 +274,7 @@ namespace controller { // younger than 7 days, schedule for created + 7 days else { auto runDateTime = created + Poco::Timespan(7, 0, 0, 0, 0); - ServerConfig::g_CronJobsTimer.schedule(new VerificationEmailResendTimerTask(user_id), Poco::Timestamp(runDateTime.microsecond())); + ServerConfig::g_CronJobsTimer.schedule(new VerificationEmailResendTimerTask(user_id), Poco::Timestamp(runDateTime.timestamp())); count_scheduled++; } } diff --git a/src/cpp/model/table/EmailOptIn.cpp b/src/cpp/model/table/EmailOptIn.cpp index 844c12e43..e4cc8a021 100644 --- a/src/cpp/model/table/EmailOptIn.cpp +++ b/src/cpp/model/table/EmailOptIn.cpp @@ -90,7 +90,7 @@ namespace model { throw Poco::NullValueException("EmailOptIn::_loadFromDB fieldNames empty or contain only one field"); } - select << "SELECT user_id, verification_code, email_opt_in_type_id, created, resend_count FROM " << getTableName() + select << "SELECT id, user_id, verification_code, email_opt_in_type_id, created, resend_count FROM " << getTableName() << " where " << fieldNames[0] << " = ? "; if (conditionType == MYSQL_CONDITION_AND) { for (int i = 1; i < fieldNames.size(); i++) { @@ -106,7 +106,7 @@ namespace model { addError(new ParamError("EmailOptIn::_loadFromDB", "condition type not implemented", conditionType)); } //<< " where " << fieldName << " = ?" - select , into(mUserId), into(mEmailVerificationCode), into(mType), into(mCreated), into(mResendCount); + select , into(mID), into(mUserId), into(mEmailVerificationCode), into(mType), into(mCreated), into(mResendCount); return select;