diff --git a/app/adminapi/lists/custom/CustomContactsLists.php b/app/adminapi/lists/custom/CustomContactsLists.php index e441e8bb6..777d64756 100644 --- a/app/adminapi/lists/custom/CustomContactsLists.php +++ b/app/adminapi/lists/custom/CustomContactsLists.php @@ -57,7 +57,6 @@ class CustomContactsLists extends BaseAdminDataLists implements ListsSearchInter return CustomContacts::where($this->searchWhere) ->field(['id', 'custom_id', 'name', 'position', 'phone', 'telephone', 'email', 'notes', 'annex', 'status']) ->limit($this->limitOffset, $this->limitLength) - ->with(['customName']) ->order(['id' => 'desc']) ->select() ->toArray(); diff --git a/app/adminapi/logic/custom/CustomContactsLogic.php b/app/adminapi/logic/custom/CustomContactsLogic.php index c44afeff4..91781dd99 100644 --- a/app/adminapi/logic/custom/CustomContactsLogic.php +++ b/app/adminapi/logic/custom/CustomContactsLogic.php @@ -117,6 +117,6 @@ class CustomContactsLogic extends BaseLogic */ public static function detail($params): array { - return CustomContacts::findOrEmpty($params['id'])->toArray(); + return CustomContacts::with(['customName'])->findOrEmpty($params['id'])->toArray(); } } \ No newline at end of file