【问题标题】:Filter employees by profile_id in back office Employees tab在后台员工选项卡中按 profile_id 过滤员工
【发布时间】:2015-02-08 13:46:19
【问题描述】:

我尝试在后台的“员工”选项卡上按个人资料应用过滤器,只需要列出 profile_id = 6 的员工。

我在 AdminEmployeesController.php 第 175 到 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();
}

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

Prestashop 1.6.0.11

【问题讨论】:

    标签: sql prestashop prestashop-1.6


    【解决方案1】:

    你可以修改_where变量:

    $this->_where = 'AND a.`id_profile` = 6';
    
    return parent::renderList();
    

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

    /overrides/controllers/admin/AdminEmployeesController.php

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-04-14
      • 1970-01-01
      • 1970-01-01
      • 2015-10-07
      • 2015-12-07
      相关资源
      最近更新 更多