add queries for work with contacts
This commit is contained in:
parent
ced29eec44
commit
dae8abec18
@ -1045,3 +1045,13 @@ WHERE AccountID = $1 AND Deleted = false;
|
||||
UPDATE privileges p SET amount = amount - 1 FROM account a
|
||||
WHERE p.account_id = a.id AND a.user_id = $1 AND p.privilegeID = $2 AND p.amount > 0
|
||||
RETURNING p.id, p.privilegeID, p.account_id, p.privilege_name, p.amount, p.created_at;
|
||||
|
||||
-- name: GetExistingContactAmo :one
|
||||
SELECT ID, AccountID, AmoID, Field
|
||||
FROM amoContact WHERE AccountID = $1 AND (Field = $2 OR Field = $3);
|
||||
|
||||
-- name: InsertContactAmo :one
|
||||
INSERT INTO amoContact (AccountID, AmoID, Field) VALUES ($1, $2, $3) RETURNING AmoID;
|
||||
|
||||
-- name: UpdateAmoAccount :exec
|
||||
UPDATE amoContact SET Field = $1 WHERE ID = $2;
|
Loading…
Reference in New Issue
Block a user