-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathqueries.py
47 lines (43 loc) · 2.02 KB
/
queries.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
orders_by_group_query_sql = "SELECT " \
"tblorders.id," \
"tblorders.ordernum," \
"tblorders.date," \
"tblorders.invoiceid," \
"tblorders.status," \
"tblorders.amount," \
"tblclients.id," \
"tblclients.firstname," \
"tblclients.lastname," \
"tblclients.companyname," \
"tblclients.email " \
"FROM tblorders " \
"INNER JOIN tblclients " \
"ON tblclients.id=tblorders.userid " \
"WHERE (tblorders.date LIKE '{}-%') " \
"AND (tblorders.status='Active') " \
"AND (tblclients.groupid={})"
# Query without passing client group ID
orders_query_sql = "SELECT " \
"tblorders.id," \
"tblorders.ordernum," \
"tblorders.date," \
"tblorders.invoiceid," \
"tblorders.status," \
"tblorders.amount," \
"tblclients.id," \
"tblclients.firstname," \
"tblclients.lastname," \
"tblclients.companyname," \
"tblclients.email " \
"FROM tblorders " \
"INNER JOIN tblclients " \
"ON tblclients.id=tblorders.userid " \
"WHERE (tblorders.date LIKE '{}-%') " \
"AND (tblorders.status='Active')"
# Query product status assigned for each order
product_status_query_sql = "SELECT id," \
" domain," \
" domainstatus," \
" orderid" \
" FROM tblhosting" \
" WHERE orderid={}"