나는 원산지 국가의 고객을 열거하는 prestashop 용 탭을 쓰고 있습니다. 지금까지는 괜찮 았지만 쿼리 나 테이블을 국가별로 필터링하여 다음과 같이 추가하고 싶습니다. WHERE iso_code = 'IT' 분명히 prestashop은 허용하지 않습니다. 어떻게 할 수 있습니까? 이 내 코드입니다 : 여기Prestashop Admin Tab - Clausole이 작동하지 않는 곳
<?php
include_once(PS_ADMIN_DIR.'/../classes/AdminTab.php');
class AdminCustomersCountries extends AdminTab
{
public function __construct()
{
$this->table = 'customer';
$this->className = 'Customer';
$this->lang = false;
$this->edit = false;
$this->view = true;
$this->delete = false;
$this->deleted = false;
$this->requiredDatabase = true;
$this->_select = '(SELECT cy.iso_code FROM ps_address AS addr, ps_country AS cy WHERE addr.id_customer=a.id_customer AND addr.id_country=cy.id_country) AS iso_code';
$this->fieldsDisplay = array(
'id_customer' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25),
'lastname' => array('title' => $this->l('Last Name'), 'width' => 80),
'firstname' => array('title' => $this->l('First name'), 'width' => 60),
'email' => array('title' => $this->l('E-mail address'), 'width' => 120, 'maxlength' => 19),
'active' => array('title' => $this->l('Enabled'), 'width' => 25, 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false),
'newsletter' => array('title' => $this->l('News.'), 'width' => 25, 'align' => 'center', 'type' => 'bool', 'callback' => 'printNewsIcon', 'orderby' => false),
'iso_code' => array('title' => "Nazione", 'width' => 60, 'orderby'=>false, 'search'=>false));
$this->optionTitle = "Prova";
parent::__construct();
}
public function postProcess()
{
// This function is executed when the Submit button is clicked
// Use it to store the value of text fields in the database
parent::postProcess();
}
public function displayForm($token=NULL)
{
// This function can be used to create a form with text fields
}
}
?>
그러나, 나는 아무 결과, WHERE 절을 추가하려고 :
<?php
include_once(PS_ADMIN_DIR.'/../classes/AdminTab.php');
class AdminCustomersCountries extends AdminTab
{
public function __construct()
{
$this->table = 'customer';
$this->className = 'Customer';
$this->lang = false;
$this->edit = false;
$this->view = true;
$this->delete = false;
$this->deleted = false;
$this->requiredDatabase = true;
$this->_select = '(SELECT cy.iso_code FROM ps_address AS addr, ps_country AS cy WHERE addr.id_customer=a.id_customer AND addr.id_country=cy.id_country AND cy.iso_code='IT') AS iso_code';
$this->fieldsDisplay = array(
'id_customer' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25),
'lastname' => array('title' => $this->l('Last Name'), 'width' => 80),
'firstname' => array('title' => $this->l('First name'), 'width' => 60),
'email' => array('title' => $this->l('E-mail address'), 'width' => 120, 'maxlength' => 19),
'active' => array('title' => $this->l('Enabled'), 'width' => 25, 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false),
'newsletter' => array('title' => $this->l('News.'), 'width' => 25, 'align' => 'center', 'type' => 'bool', 'callback' => 'printNewsIcon', 'orderby' => false),
'iso_code' => array('title' => "Nazione", 'width' => 60, 'orderby'=>false, 'search'=>false));
$this->optionTitle = "Prova";
parent::__construct();
}
public function postProcess()
{
// This function is executed when the Submit button is clicked
// Use it to store the value of text fields in the database
parent::postProcess();
}
public function displayForm($token=NULL)
{
// This function can be used to create a form with text fields
}
}
?>
죄송합니다. 게시 된 두 번째 코드를 편집 할 때 작성 오류가 발생했습니다. 그러나 cy.iso_code = \ 'IT \'로 시도했지만 작동하지 않습니다 .. – user2443268
흠 ... 어쩌면 그것은'선택 cy.iso_code FROM ps_address'입니다. 늘어나는만큼 내가 잘못된 테이블에서 iso_code를 요청하고 있다고 말할 수 있습니다. SELECT SQL_CALC_FOUND_ROWS \t \t \t : – Aram
음에는, 시스템은 나에게, 나는 절 또는 PrestaShop 버전 기능 – user2443268