@@ -190,20 +190,36 @@ export function getCreatorsDayDataQuery(filters: RankingsFilters, page = 0) {
190
190
191
191
return filters . from === 0
192
192
? SQL `
193
- SELECT id, sales, earned, unique_collections_sales, unique_collectors_total
194
- FROM accounts
195
- WHERE ` . append ( where ) . append ( SQL `
196
- ORDER BY ${ orderBy } ${ orderDirection }
193
+ SELECT id, sales, earned, unique_collections_sales as "uniqueCollectionsSales", unique_collectors_total as "uniqueCollectorsTotal"
194
+ FROM `
195
+ . append ( MARKETPLACE_SQUID_SCHEMA )
196
+ . append (
197
+ SQL `.accounts
198
+ WHERE `
199
+ . append ( where )
200
+ . append (
201
+ SQL `
202
+ ORDER BY ${ orderBy } ` . append ( orderDirection ) . append ( SQL `
197
203
${ filters . first ? SQL `LIMIT ${ filters . first } ` : SQL `` }
198
204
` )
205
+ )
206
+ )
199
207
: SQL `
200
- SELECT id, sales, earned, unique_collections_sales, unique_collectors_total
201
- FROM accounts_day_data
202
- WHERE ` . append ( where ) . append ( SQL `
203
- ORDER BY ${ orderBy } ${ orderDirection }
208
+ SELECT id, sales, earned, unique_collections_sales as "uniqueCollectionsSales", unique_collectors_total as "uniqueCollectorsTotal"
209
+ FROM `
210
+ . append ( MARKETPLACE_SQUID_SCHEMA )
211
+ . append (
212
+ SQL `.accounts_day_data
213
+ WHERE `
214
+ . append ( where )
215
+ . append (
216
+ SQL `
217
+ ORDER BY ${ orderBy } ` . append ( orderDirection ) . append ( SQL `
204
218
LIMIT ${ MAX_RESULTS }
205
219
OFFSET ${ MAX_RESULTS * page }
206
220
` )
221
+ )
222
+ )
207
223
}
208
224
209
225
// Collectors
@@ -212,20 +228,36 @@ export function getCollectorsDayDataQuery(filters: RankingsFilters, page = 0) {
212
228
213
229
return filters . from === 0
214
230
? SQL `
215
- SELECT id, purchases, spent, unique_and_mythic_items, creators_supported_total
216
- FROM accounts
217
- WHERE ` . append ( where ) . append ( SQL `
218
- ORDER BY ${ orderBy } ${ orderDirection }
231
+ SELECT id, purchases, spent, unique_and_mythic_items as "uniqueAndMythicItems", creators_supported_total as "creatorsSupportedTotal"
232
+ FROM `
233
+ . append ( MARKETPLACE_SQUID_SCHEMA )
234
+ . append (
235
+ SQL `.accounts
236
+ WHERE `
237
+ . append ( where )
238
+ . append (
239
+ SQL `
240
+ ORDER BY ${ orderBy } ` . append ( orderDirection ) . append ( SQL `
219
241
${ filters . first ? SQL `LIMIT ${ filters . first } ` : SQL `` }
220
242
` )
243
+ )
244
+ )
221
245
: SQL `
222
- SELECT id, purchases, spent, unique_and_mythic_items, creators_supported_total
223
- FROM accounts_day_data
224
- WHERE ` . append ( where ) . append ( SQL `
225
- ORDER BY ${ orderBy } ${ orderDirection }
246
+ SELECT id, purchases, spent, unique_and_mythic_items as "uniqueAndMythicItems", creators_supported_total as "creatorsSupportedTotal"
247
+ FROM `
248
+ . append ( MARKETPLACE_SQUID_SCHEMA )
249
+ . append (
250
+ SQL `.accounts_day_data
251
+ WHERE `
252
+ . append ( where )
253
+ . append (
254
+ SQL `
255
+ ORDER BY ${ orderBy } ` . append ( orderDirection ) . append ( SQL `
226
256
LIMIT ${ MAX_RESULTS }
227
257
OFFSET ${ MAX_RESULTS * page }
228
258
` )
259
+ )
260
+ )
229
261
}
230
262
231
263
export function sortRankResults (
0 commit comments