File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 1
1
import os
2
+ import json
2
3
from google .cloud import firestore
3
4
from .result import Result
4
5
@@ -8,16 +9,23 @@ def list_data(params):
8
9
ref = DB .collection (u'reports' )
9
10
10
11
query = ref
11
-
12
+ print ( "params" , params )
12
13
if 'start' in params :
13
14
query = query .where ('date' , '>=' , params ['start' ])
14
15
if 'end' in params :
15
- query = query .where ('date' , '<' , params ['end' ])
16
+ query = query .where ('date' , '<= ' , params ['end' ])
16
17
if 'category' in params :
17
18
query = query .where ('category' , '==' , params ['category' ])
18
19
if 'geo' in params :
19
20
query = query .where ('geo' , '==' , params ['geo' ])
20
-
21
+ if 'app' in params :
22
+ params_array = json .loads (params ['app' ])
23
+ query = query .where ('app' , 'in' , params_array )
24
+ if 'client' in params :
25
+ query = query .where ('client' , '==' , params ['client' ])
26
+ if 'rank' in params :
27
+ query = query .where ('rank' , '==' , params ['rank' ])
28
+
21
29
documents = query .stream ()
22
30
23
31
data = {}
You can’t perform that action at this time.
0 commit comments