/** * получаем список манегеров */ public function action_managers() { $this->title[] = 'Менеджеры'; $filter = $this->request->query('filter') ?: ['only_managers' => 1]; $user = Auth::instance()->get_user(); $params = ['agent_id' => $user['AGENT_ID'], 'not_admin' => true]; $params = array_merge($params, $filter); $managers = Model_Manager::getManagersList($params); $popupManagerAdd = Common::popupForm('Добавление менеджера', 'manager/add'); $this->tpl->bind('managers', $managers)->bind('popupManagerAdd', $popupManagerAdd)->bind('filter', $filter); }
/** * получаем список клиентов для combobox */ public function action_list_manager_sale() { $res = Model_Manager::getManagersList(['search' => $this->_search, 'role_id' => [Access::ROLE_MANAGER_SALE, Access::ROLE_MANAGER_SALE_SUPPORT], 'agent_id' => $this->_user['AGENT_ID'], 'manager_id' => $this->_ids]); if (empty($res)) { $this->jsonResult(false); } $return = []; foreach ($res as $item) { $return[] = ['name' => $item['M_NAME'], 'value' => $item['MANAGER_ID']]; } $this->jsonResult(true, $return); }