feat: finish back-end work (untested)
This commit is contained in:
@@ -64,11 +64,15 @@ func GetOrderTableQueryString(filter int64) string {
|
||||
ORDER BY date_due ` + order + `
|
||||
OFFSET $1
|
||||
LIMIT $2;
|
||||
|
||||
`
|
||||
filter = filter & ^ASCEND_DATE_DUE
|
||||
|
||||
conditions := ""
|
||||
conditions := `
|
||||
WHERE
|
||||
orderer LIKE '%' || $3 || '%'
|
||||
AND TO_CHAR(date_due, 'YYYY-MM-DD') LIKE '%' || $4 || '%'
|
||||
AND TO_CHAR(date_placed, 'YYYY-MM-DD') LIKE '%' || $5 || '%'
|
||||
`
|
||||
if filter > 0 {
|
||||
if filter&FUTURE_FILTER > 0 {
|
||||
conditions += "AND date_due > now()\n"
|
||||
@@ -94,9 +98,6 @@ func GetOrderTableQueryString(filter int64) string {
|
||||
if filter&UNPAID_FILTER > 0 {
|
||||
conditions += "AND paid = FALSE\n"
|
||||
}
|
||||
if len(conditions) > 0 {
|
||||
conditions = "WHERE " + conditions[4:]
|
||||
}
|
||||
}
|
||||
|
||||
query_string := query_string_first_part + conditions + query_string_second_part
|
||||
|
||||
Reference in New Issue
Block a user