voila, ca devrais etre bon...
(SELECT COUNT(*) FROM '._DB_PREFIX_.'orders o where o.valid =1 AND (o.id_customer = a.id_customer)) AS orders';
attention j'ai changé order par orders ligne 117, car order en sql c'est une commande... ca le fait moyen...
J'aime pas trop mettre un "SELECT" comme J'ai fais mais ca marche... je pense que l'on pourait faire ca en LEFT JOIN
J'espere que je réponds a ta question...
ligne 70 :
$this->_select = '
a.date_add,
IF (YEAR(`birthday`) = 0, "-", (YEAR(CURRENT_DATE)-YEAR(`birthday`)) - (RIGHT(CURRENT_DATE, 5) < RIGHT(birthday, 5))) AS `age`, (
SELECT c.date_add FROM '._DB_PREFIX_.'guest g
LEFT JOIN '._DB_PREFIX_.'connections c ON c.id_guest = g.id_guest
WHERE g.id_customer = a.id_customer
ORDER BY c.date_add DESC
LIMIT 1
) as connect,
(SELECT COUNT(*) FROM '._DB_PREFIX_.'orders o where o.valid =1 AND (o.id_customer = a.id_customer)) AS orders';
$this->fields_list = array(
'id_customer' => array(
'title' => $this->l('ID'),
'align' => 'center',
'width' => 20
),
'id_gender' => array(
'title' => $this->l('Title'),
'width' => 70,
'align' => 'center',
'icon' => $genders_icon,
'orderby' => false,
'type' => 'select',
'list' => $genders,
'filter_key' => 'a!id_gender',
),
'lastname' => array(
'title' => $this->l('Last name'),
'width' => 'auto'
),
'firstname' => array(
'title' => $this->l('First Name'),
'width' => 'auto'
),
'email' => array(
'title' => $this->l('Email address'),
'width' => 140,
),
'Company' => array(
'title' => $this->l('Company'),
'width' => 140,
),
'SIRET' => array(
'title' => $this->l('SIRET'),
'width' => 140,
),
'orders' => array(
'title' => $this->l('Coms'),
'width' => 60,
),