feat: finish back-end work (untested)

This commit is contained in:
2025-11-12 12:58:21 -07:00
parent b6a08573f3
commit 8b351524b8
18 changed files with 300 additions and 27 deletions

View File

@@ -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