我想在Prestashop 1.6上为我的模块创建一个自定义列表,我需要从三个不同的表中获取数据。我的问题是$this->_filter
变量,我该怎么做?在我的模块上筛选Prestashop 1.6
我需要这样做:
$query = '
SELECT s.*, pl.*
FROM '._DB_PREFIX_.'`scd_gift` s
INNER JOIN '._DB_PREFIX_.'product_lang pl
ON s.id_product = pl.id_product
WHERE s.`id_gift_type` = '.(int)$id_gift_type.' and id_lang='.$id_lang;
这里是我的功能:
public function getCustomListHostessGifts() {
$this->table = 'scd_gift';
$this->list_id = 'hostess_gift';
$this->lang = true;
$this->identifier = 'id_scd_gift';
$this->_orderBy = 'id_product';
$this->_orderWay = 'DESC';
$this->addRowAction('delete');
$this->fields_list = (array(
'id_product' => array('title' => $this->l('ID'), 'class' => 'fixed-width-xs',
'align' => 'center'),
'name' => array('title' => $this->l('Name'), 'filter_key' => 'b!name'),
));
$this->clearFilters();
$hostessType = MlmGiftsModule::getGiftTypeIdByGiftTypeName('_HOSTESSGIFT_');
$this->_join = Shop::addSqlAssociation('scd_gift', 'a');
$this->_filter = '
INNER JOIN '._DB_PREFIX_.'product_lang pl
ON s.id_product = pl.id_product
AND a.`id_gift_type` ='.$hostessType ;
$this->toolbar_title = $this->l('Hostess gifts:');
return $this->renderList();
}