Filter employees by profile_id in back office Employees tab

喜夏-厌秋 提交于 2019-12-12 04:54:54

问题


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:


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



来源:https://stackoverflow.com/questions/28394610/filter-employees-by-profile-id-in-back-office-employees-tab

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!