Filter employees by profile_id in back office Empl

2019-09-14 07:14发布

i try to apply a filter by profile on my tab "employees" in back-office, just need to list the employees with profile_id = 6.

I found this part of code in AdminEmployeesController.php, line 175 to 184 :

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();
}

but I don't found the correct solution till now; Can somebody help me?

Prestashop 1.6.0.11

1条回答
我命由我不由天
2楼-- · 2019-09-14 07:59

You may modify _where variable:

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

return parent::renderList();

Please dont forget to place your override in overriden class in

/overrides/controllers/admin/AdminEmployeesController.php

查看更多
登录 后发表回答