<?php
 namespace Modules\Admin\Departments; class Model extends \App\Mvc\Model_ListingAbstract { public function list_execute(\App\Mvc\View\Listing\Members\Params $listingParams) { $filters=$listingParams->getFilters(); $listObj = new \App\EntityList\Departments(); $listObj->setColumns(['name', 'code', 'addTime', 'idAddUser']); if ($filters['text']) { $listObj->setCustomFilter("dept.name LIKE ? OR dept.code LIKE ?", ["%{$filters['text']}%", "%{$filters['text']}%"]); } if ($filters['addUser']['id']) { $listObj->setFilter('dept.idAddUser', '=', $filters['addUser']['id']); } $listObj = $this->entityList_inheritListingParams($listingParams, $listObj); $this->recordsList = $listObj->exportRecords(); $this->totalRecordsCount = $listObj->getRecordsCount(); } } 