feat: add search functionality to customer page
This commit is contained in:
parent
b343ce386f
commit
2a2a0a8a8b
3 changed files with 3 additions and 3 deletions
|
|
@ -2,7 +2,7 @@ const db = require('../db')
|
|||
const cashInTx = require('../cash-in/cash-in-tx')
|
||||
const { CASH_OUT_TRANSACTION_STATES } = require('../cash-out/cash-out-helper')
|
||||
|
||||
function transaction() {
|
||||
function transaction () {
|
||||
const sql = `SELECT DISTINCT * FROM (
|
||||
SELECT 'type' AS type, 'Cash In' AS value UNION
|
||||
SELECT 'type' AS type, 'Cash Out' AS value UNION
|
||||
|
|
@ -27,7 +27,7 @@ function transaction() {
|
|||
return db.any(sql)
|
||||
}
|
||||
|
||||
function customer() {
|
||||
function customer () {
|
||||
const sql = `SELECT DISTINCT * FROM (
|
||||
SELECT 'phone' AS type, phone AS value FROM customers WHERE phone IS NOT NULL UNION
|
||||
SELECT 'name' AS type, id_card_data::json->>'firstName' AS value FROM customers WHERE id_card_data::json->>'firstName' IS NOT NULL AND id_card_data::json->>'lastName' IS NULL UNION
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue