revisiondaosqlite: Don't ignore page visibility setting
This commit is contained in:
父節點
879a9f1c24
當前提交
89c662385d
@ -54,9 +54,8 @@ std::vector<Revision> RevisionDaoSqlite::getAllRevisions(QueryOption &options)
|
||||
try
|
||||
{
|
||||
SqliteQueryOption queryOption { options };
|
||||
std::string queryOptionSql = queryOption.setPrependWhere(true).setOrderByColumn("id").build();
|
||||
|
||||
auto query = *db << "SELECT author, comment, content, strftime('%s',creationtime), (SELECT name FROM page WHERE page.id = page ), revisionid FROM revision " + queryOptionSql;
|
||||
std::string queryOptionSql = queryOption.setPrependWhere(true).setVisibleColumnName("page.visible").setOrderByColumn("revisionid").build();
|
||||
auto query = *db << "SELECT (SELECT username FROM user WHERE id = author), comment, content, strftime('%s',creationtime), page.name, revisionid FROM revision INNER JOIN page ON revision.page = page.id " + queryOptionSql;
|
||||
query >> [&](std::string author, std::string comment, std::string content, time_t creationtime, std::string page, unsigned int revisionid)
|
||||
{
|
||||
Revision r;
|
||||
@ -87,9 +86,8 @@ std::vector<Revision> RevisionDaoSqlite::getAllRevisionsForPage(std::string page
|
||||
try
|
||||
{
|
||||
SqliteQueryOption queryOption { option };
|
||||
std::string queryOptionSql = queryOption.setPrependWhere(false).setOrderByColumn("id").build();
|
||||
|
||||
auto query = *db << "SELECT (SELECT username FROM user WHERE id = author), comment, content, strftime('%s',creationtime), (SELECT name FROM page WHERE page.id = page ), revisionid FROM revision WHERE page = (SELECT id FROM page WHERE name = ?) " + queryOptionSql << pagename;
|
||||
std::string queryOptionSql = queryOption.setPrependWhere(false).setVisibleColumnName("page.visible").setOrderByColumn("revisionid").build();
|
||||
auto query = *db << "SELECT (SELECT username FROM user WHERE id = author), comment, content, strftime('%s',creationtime), page.name, revisionid FROM revision INNER JOIN page ON revision.page = page.id WHERE page.name = ? AND " + queryOptionSql << pagename;
|
||||
|
||||
query >> [&](std::string author, std::string comment, std::string content, time_t creationtime, std::string page, unsigned int revisionid)
|
||||
{
|
||||
|
載入中…
新增問題並參考
Block a user