在后台“员工”选项卡中按 profile_id 筛选员工

Filter employees by profile_id in back office Employees tab

我尝试在后台的 "employees" 选项卡上按配置文件应用过滤器,只需要列出 profile_id = 6 的员工。

我在第 175 到 184 行 AdminEmployeesController.php 中找到了这部分代码:

public function renderList()
{
  $this->_select = 'pl.`name` AS profile ';


$this->_join = 'LEFT JOIN `'._DB_PREFIX_.'profile` p ON a.`id_profile` =      p.`id_profile`
LEFT JOIN `'._DB_PREFIX_.'profile_lang` pl ON (pl.`id_profile` =  p.`id_profile`  AND pl.`id_lang` = '
.(int)$this->context->language->id.') ';


return parent::renderList();
}

但直到现在我还没有找到正确的解决方案;有人可以帮助我吗?

Prestashop 1.6.0.11

您可以修改_where变量:

$this->_where = 'AND a.`id_profile` = 6';

return parent::renderList();

请不要忘记将您的覆盖放在

中的覆盖 class 中

/overrides/controllers/admin/AdminEmployeesController.php