我正在做的PrestaShop 1.6插件,在那裏我可以配置通過的costumers折扣顯示客戶的名字,我見下表:的Prestashop:內連接列表中的
create table ps_discountbycustomer
(
id_discountbycustomer int not null auto_increment
primary key,
id_customer int not null,
date_start datetime not null,
date_end datetime not null,
use_percentage bit not null,
percentage_order float not null,
percentage_shipping float not null,
value_order float not null,
value_shipping float not null
);
我如何讓我的控制器類:
class AdminDiscountbycustomerController extends AdminController
{
public function __construct()
{
$this->bootstrap = true;
$this->table = 'discountbycustomer';
$this->className = 'DiscountbycustomerModel';
$this->identifier = 'id_discountbycustomer';
parent::__construct();
$this->lang = false;
$this->_join = 'INNER JOIN '._DB_PREFIX_.'customer c ON (a.id_customer = c.id_customer)';
// Building the list of records stored within the "test" table
$this->fields_list = array(
// 'id_discountbycustomer' => [
// 'title' => $this->l('ID'),
// 'align' => 'center',
// 'width' => 25
// ],
'id_customer' => [
'title' => $this->l('Customer'),
'width' => 'auto'
],
'date_start' => [
'title' => $this->l('Starts'),
'width' => 'auto',
'type' => 'date'
],
'date_end' => [
'title' => $this->l('Ends'),
'width' => 'auto',
'type' => 'date'
],
'use_percentage' => [
'title' => $this->l('Use Percentage'),
'active' => 'use_percentage',
'align' => 'text-center',
'class' => 'fixed-width-sm'
],
'percentage_order' => [
'title' => $this->l('Order %'),
'width' => 'auto',
'type' => 'float'
],
'percentage_shipping' => [
'title' => $this->l('Shipping %'),
'width' => 'auto',
'type' => 'float'
],
'value_order' => [
'title' => $this->l('Order %'),
'width' => 'auto',
'type' => 'float'
],
'value_shipping' => [
'title' => $this->l('Shipping %'),
'width' => 'auto',
'type' => 'float'
],
);
// This adds a multiple deletion button
$this->bulk_actions = array(
'delete' => array(
'text' => $this->l('Delete selected'),
'confirm' => $this->l('Delete selected items?')
)
);
parent::__construct();
}
}
我的問題是,我不知道我怎麼能在加負荷消費列數組,以便我可以獲取列表中顯示的客戶名稱。
我該怎麼做?我正在使用PrestaShop 1.6.1.12。 感謝您的幫助
謝謝!工作得很好! –