kopia lustrzana https://gitlab.com/tomaszg/geostat
OCdb exclude owned caches in not found list, extract also cache name
rodzic
8e15d95be6
commit
e00ce62e72
3
ocdb.cpp
3
ocdb.cpp
|
@ -316,7 +316,7 @@ Caches OCdb::get_user_caches_not_found(const std::string& uuid) const {
|
|||
Caches cc;
|
||||
Cache c;
|
||||
|
||||
std::string sql = "SELECT code, location FROM caches WHERE status = 'Available' AND NOT EXISTS (SELECT cache_code FROM logs WHERE cache_code = code AND type = 1 and user = ?);";
|
||||
std::string sql = "SELECT code, location, name FROM caches WHERE status = 'Available' AND NOT EXISTS (SELECT cache_code FROM logs WHERE cache_code = code AND type = 1 and user = ?1) AND owner != ?1;";
|
||||
|
||||
res = sqlite3_prepare_v2(db, sql.c_str(), sql.length() + 1, &stmt, NULL);
|
||||
if (res != SQLITE_OK) {
|
||||
|
@ -330,6 +330,7 @@ Caches OCdb::get_user_caches_not_found(const std::string& uuid) const {
|
|||
while (res == SQLITE_ROW) {
|
||||
c.code = reinterpret_cast<const char*>(sqlite3_column_text(stmt, 0));
|
||||
c.pos = get_lat_lon(reinterpret_cast<const char*>(sqlite3_column_text(stmt, 1)));
|
||||
c.name = reinterpret_cast<const char*>(sqlite3_column_text(stmt, 2));
|
||||
c.status = ok;
|
||||
cc.push_back(c);
|
||||
res = sqlite3_step(stmt);
|
||||
|
|
Ładowanie…
Reference in New Issue