Skip to content

Commit

Permalink
Fixes old promotions not being displayed in the total
Browse files Browse the repository at this point in the history
  • Loading branch information
NejcZdovc committed May 15, 2020
1 parent 063f0e1 commit 2d8ae48
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -441,8 +441,8 @@ void DatabaseUnblindedToken::GetRecordsByTriggerIds(
const std::string query = base::StringPrintf(
"SELECT ut.token_id, ut.token_value, ut.public_key, ut.value, "
"ut.creds_id, ut.expires_at FROM %s as ut "
"INNER JOIN creds_batch as cb ON cb.creds_id = ut.creds_id "
"WHERE cb.trigger_id IN (%s)",
"LEFT JOIN creds_batch as cb ON cb.creds_id = ut.creds_id "
"WHERE cb.trigger_id IN (%s) OR ut.creds_id IS NULL",
kTableName,
GenerateStringInCase(trigger_ids).c_str());

Expand Down Expand Up @@ -523,10 +523,10 @@ void DatabaseUnblindedToken::GetSpendableRecordListByBatchTypes(
const std::string query = base::StringPrintf(
"SELECT ut.token_id, ut.token_value, ut.public_key, ut.value, "
"ut.creds_id, ut.expires_at FROM %s as ut "
"INNER JOIN creds_batch as cb ON cb.creds_id = ut.creds_id "
"LEFT JOIN creds_batch as cb ON cb.creds_id = ut.creds_id "
"WHERE ut.redeemed_at = 0 AND "
"(ut.expires_at > strftime('%%s','now') OR ut.expires_at = 0) AND "
"cb.trigger_type IN (%s)",
"(cb.trigger_type IN (%s) OR ut.creds_id IS NULL)",
kTableName,
base::JoinString(in_case, ",").c_str());

Expand Down

0 comments on commit 2d8ae48

Please sign in to comment.