This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
asdasd | |
asdasd | |
1048 | |
asdasd,..,)('("( | |
asdasd'UBhkRE<'">vKGlUg | |
asdasd') AND 7407=5590-- AjWz | |
asdasd' AND 3214=9409-- yiYl | |
asdasd" AND 5475=4769-- hTNB | |
asdasd') AND 5834=2373 AND ('ytdz'='ytdz | |
asdasd')) AND 4186=2893 AND (('LqKP'='LqKP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BEGIN TRANSACTION; | |
alter table transactions | |
add tr_document_password_owner text, | |
add tr_doctype_id guid, | |
add tr_document_date date, | |
add tr_document_number text, | |
add tr_document_description text, | |
add tr_document_owner_name text, | |
add tr_document_owner_user_id guid, | |
add tr_document_owner_structure_id guid, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create function all_doc_type_counters(mailbox_id_in text, profile_id_in text, structure_id_in text) returns json | |
language plpgsql | |
as | |
$$ | |
DECLARE owner_reaction_doctype_id text[]; | |
DECLARE partner_reaction_doctype_id text[]; | |
DECLARE departments text; | |
DECLARE result_json json; | |
DECLARE visibility_zone integer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create or replace function doc_counters( | |
mailbox_id_in text, | |
profile_id_in text, | |
structure_id_in text | |
) | |
RETURNS json | |
AS | |
$$ | |
DECLARE owner_reaction integer; | |
DECLARE partner_reaction integer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UPDATE documents set document_total_sum = tmp_sel.summa FROM | |
(SELECT documents.document_id, cast(sum(vat_total_sum) as numeric(20,2)) as summa from documents LEFT JOIN value_params vp on documents.document_id = vp.document_id | |
LEFT JOIN goods g on vp.value_param_id = g.value_param_id | |
WHERE param_id = '78624016-1195-4301-8576-cfabead6c9c9' group by documents.document_id) as tmp_sel | |
WHERE documents.document_id = tmp_sel.document_id; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BEGIN TRANSACTION; | |
INSERT INTO signatures (document_id, signature_pkcs7, signature_data, signature_role) | |
( | |
SELECT document_id, document_owner_pkcs7 as sign, document_sign_from_json as json, 'owner' as role FROM documents where document_owner_pkcs7 IS NOT NULL | |
UNION ALL | |
SELECT document_id, document_contragent_pkcs7 as sign, document_sign_from_json as json, 'contragent' as role FROM documents where document_contragent_pkcs7 IS NOT NULL | |
UNION ALL | |
SELECT document_id, document_confidant_pkcs7 as sign, document_confidant_sign_json as json, 'confidant' as role FROM documents where document_confidant_pkcs7 IS NOT NULL | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT CAST(document_data::json->>'EmpowermentId' AS char(24)) as internal_id, document_id from documents where | |
doctype_id = '945dde7f-b55e-4666-990c-749751a3c726' | |
and document_id <> CAST(document_data::json->>'EmpowermentId' AS char(24)) | |
and CAST(document_data::json->>'EmpowermentId' AS char(24)) <> ' ' | |
and CAST(document_data::json->>'EmpowermentId' AS char(24)) IS NOT NULL; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
START TRANSACTION; | |
-- дропаем рестикты | |
ALTER TABLE transactions DROP CONSTRAINT fk_transact_reference_document; | |
ALTER TABLE value_params DROP CONSTRAINT fk_value_pa_reference_document; | |
-- создаём каскадный update для value params | |
ALTER TABLE value_params ADD CONSTRAINT fk_value_pa_reference_document_upd | |
FOREIGN KEY (document_id) REFERENCES documents(document_id) ON UPDATE CASCADE; | |
-- создаём каскадный update для transactions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH RECURSIVE catalogs_tree AS | |
( | |
SELECT | |
catalog_id, | |
1 AS hierarchy_level | |
FROM | |
catalog | |
WHERE | |
catalog_id = '".$catalog_id."' | |
AND mailbox_id = '".$session['mailbox_id']."' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php /** @noinspection PhpUndefinedMethodInspection PhpUnused */ | |
/** | |
* НЕ ИЗМЕНЯТЬ!!!!! (жене мужу и т.д., а контроллер можно но в исключительных случаях) | |
* Автор класса Александр Хакимов https://github.com/hackimov | |
* Контроллер который занимается автодеплоем на стэйджинг и продакшин. | |
* Это функционал ядра который восприимчив к изменению! | |
* Если затронуть код то автодеплой сломается, исключением является если он уже сломался по причине если сервера были перенесены или недоступны из вне! | |
*/ |
NewerOlder