diff --git a/src/mysql.cpp b/src/mysql.cpp index 8425fd9..ddef030 100644 --- a/src/mysql.cpp +++ b/src/mysql.cpp @@ -98,6 +98,20 @@ module::select& module::select::orderby(const std::string& exp) return *this; } +module::select& module::select::groupby(const std::string& exp) +{ + // TODO: 在此处插入 return 语句 + m_select->groupby(exp); + return *this; +} + +module::select& module::select::having(const std::string& exp) +{ + // TODO: 在此处插入 return 语句 + m_select->having(exp); + return *this; +} + void module::select::clear() { m_select->clear(); @@ -120,6 +134,8 @@ void module::select::regist(sol::state* lua) "field", &module::select::field, "limit", &module::select::limit, "orderby", &module::select::orderby, + "groupby", &module::select::groupby, + "having", &module::select::having, "page", &module::select::page, "table", &module::select::table, "where_dob", &module::select::where_dob, diff --git a/src/mysql.h b/src/mysql.h index cb48798..bd1ad85 100644 --- a/src/mysql.h +++ b/src/mysql.h @@ -94,6 +94,8 @@ namespace module module::select& page(uint32 page, uint32 count); module::select& limit(uint32 start, uint32 count); module::select& orderby(const std::string& exp); + module::select& groupby(const std::string& exp); + module::select& having(const std::string& exp); void clear(); std::shared_ptr query(); uint64 count();