Browse Source

fixed fetch pracownicy by group backRef in query

Piotr Labudda 7 năm trước cách đây
mục cha
commit
27eef8eff3
1 tập tin đã thay đổi với 3 bổ sung3 xóa
  1. 3 3
      tools/Bocian.php

+ 3 - 3
tools/Bocian.php

@@ -366,7 +366,7 @@ public function fetchKontrahenciAjax($args) {
 				$backRefFilter['__backRef'] = [
 					'namespace' => 'default_db/BI_audit_ENERGA_PRACOWNICY_group/BI_audit_ENERGA_KONTRAHENCIS_GRUPY', // TODO: nowy rejetr na grupy / filty KONTRAHENCI
 					'primaryKey' => $idGroup,
-					'fieldName' => 'default_db__x3A__BI_audit_ENERGA_PRACOWNICY:BI_audit_ENERGA_KONTRAHENCIS',
+					'fieldName' => 'default_db__x3A__BI_audit_ENERGA_PRACOWNICY:BI_audit_ENERGA_KONTRAHENCI',
 				];
 				// TODO: Storage dodać obiekt xsd default_db/BI_audit_ENERGA_PRACOWNICY_group/BI_audit_ENERGA_KONTRAHENCI_GRUPY:
 				// - ID
@@ -685,7 +685,7 @@ public function fetchGroupKontrahenciAjax() {
 			$backRefFilter['__backRef'] = [
 				'namespace' => 'default_db/BI_audit_ENERGA_PRACOWNICY_group/BI_audit_ENERGA_PRACOWNICY_group', // TODO: nowy rejetr na grupy / filty pracowników
 				'primaryKey' => $idGroup,
-				'fieldName' => 'default_db__x3A__BI_audit_ENERGA_PRACOWNICY_group:BI_audit_ENERGA_PRACOWNICY_group',
+				'fieldName' => 'default_db__x3A__BI_audit_ENERGA_PRACOWNICY:BI_audit_ENERGA_PRACOWNICY',
 			];
 			// TODO: Storage dodać obiekt xsd default_db/BI_audit_ENERGA_PRACOWNICY_group/BI_audit_ENERGA_PRACOWNICY_group:
 			// - ID
@@ -878,8 +878,8 @@ public function fetchGroupKontrahenciAjax() {
 			'f_ID_USER' => "=" . User::getID(), // szukamy dokładnie tej wartości - mysql: where ID_USER = "1"
 			'f_A_STATUS' => "!DELETED", // `A_STATUS` != 'DELETED'
 		]);
-		if (empty($groups)) throw new Exception("Grupa nie istnieje");
 		$items = $query->getItems();
+		if (empty($items)) throw new AlertWarningException("Grupy nie istnieją");
 
 		$arrayGroupPracownicy = array();
 		foreach ($items as $item) {