Jump to content
Jesse

[PrestaShopDatabaseException]

Recommended Posts

Bonjour,

J'ai l'erreur suivante après avoir appliqué un tri par date d'inscription dans Clients -> Clients (PS 1.6)

[PrestaShopDatabaseException]

SELECT SQL_CALC_FOUND_ROWS
								a.`id_customer`, a.`email` AS `email`, a.`company` AS `company`, a.`active` AS `active`
			, 
        a.date_add, gl.name as title, (
            SELECT SUM(total_paid_real / conversion_rate)
            FROM pstw42_orders o
            WHERE o.id_customer = a.id_customer
             AND o.id_shop IN (1) 
            AND o.valid = 1
        ) as total_spent, (
            SELECT c.date_add FROM pstw42_guest g
            LEFT JOIN pstw42_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, a.firstname as firstname,a.lastname as lastname,CONCAT('_', '::::', (SELECT COUNT(*) FROM pstw42_customer_group cg WHERE cg.id_customer=a.id_customer)) as _,'fetchGroupsFromCustomerId' as __method,a.id_customer as __id,(SELECT max(amb_add2.id_address) FROM pstw42_address amb_add2 WHERE amb_add2.deleted=0 AND amb_add2.active=1 AND amb_add2.id_customer is not null AND amb_add2.id_customer != 0 AND amb_add2.id_customer = a.id_customer) as admin_customers_default_billing_address_address_id,'admin_customers_default_billing_address' as admin_customers_default_billing_address,CONCAT(amb_address.phone, ' ', amb_address.phone_mobile) as admin_customers_phones,'fetchOrdersFromCustomerId' as ___method,a.id_customer as ___id,CONCAT('__', '::::', IFNULL((SELECT COUNT(id_order) FROM pstw42_orders acoc_o INNER JOIN pstw42_order_state acoc_os ON acoc_o.current_state = acoc_os.id_order_state WHERE acoc_os.logable=1 and acoc_o.id_customer = a.id_customer),0)) as __,'fetchOrderedCartsFromCustomerId' as ____method,a.id_customer as ____id,CONCAT('___', '::::', IFNULL((SELECT COUNT(acoc_c.id_cart) FROM pstw42_cart acoc_c LEFT JOIN pstw42_orders acoc_o ON acoc_o.id_cart=acoc_c.id_cart WHERE acoc_c.id_customer = a.id_customer AND acoc_o.id_order IS NOT NULL), 0)) as ___,a.birthday as admin_customers_birthday,(FLOOR(DATEDIFF(CURDATE(), a.birthday)/365)) as admin_customers_age,(SELECT iso_code FROM pstw42_lang acl_l WHERE acl_l.id_lang=(SELECT o.id_lang FROM pstw42_orders o WHERE o.id_customer=a.id_customer ORDER BY id_order DESC LIMIT 1)) as admin_customers_language,CONCAT('____', '::::', a.note) as ____,(SELECT MAX(invoice_date) FROM pstw42_orders aclo_o INNER JOIN pstw42_order_state aclo_os ON aclo_o.current_state = aclo_os.id_order_state WHERE aclo_os.logable=1 AND aclo_o.id_customer=a.id_customer) as admin_customers_last_order,(SELECT SUM(total_products) FROM pstw42_orders acth_o INNER JOIN pstw42_order_state acth_os ON acth_o.current_state = acth_os.id_order_state WHERE acth_os.logable=1 AND acth_o.id_customer=a.id_customer) as admin_customers_total_ht,'fetchCartRulesFromCustomerId' as ______method,a.id_customer as ______id,CONCAT('_____', '::::', (SELECT COUNT(id_cart_rule) FROM pstw42_cart_rule acdl_cr WHERE acdl_cr.id_customer = a.id_customer)) as _____,CONCAT('______', '::::', (SELECT CONCAT(UCASE(LEFT(acct_ct.status, 1)), SUBSTRING(acct_ct.status, 2)) FROM pstw42_customer_thread acct_ct WHERE acct_ct.id_customer=a.id_customer ORDER BY acct_ct.id_customer_thread DESC LIMIT 1)) as ______,'AdminCustomerThreads' as _______controller,CONCAT('id_customer_thread=', (SELECT MAX(id_customer_thread) FROM pstw42_customer_thread acct_ct WHERE acct_ct.id_customer=a.id_customer) , '&viewcustomer_thread') as _______params,'AdminCustomerThreads' as _______translator, CASE        when ((count(id_order) - avg_orders) / avg_orders)  > 1 THEN 5        when ((count(id_order) - avg_orders) / avg_orders)  BETWEEN 0.6 AND 1 THEN 4        when ((count(id_order) - avg_orders) / avg_orders)  BETWEEN 0.2 AND 0.6 THEN 3        when ((count(id_order) - avg_orders) / avg_orders)  BETWEEN 0 AND 0.2 THEN 2        when ((count(id_order) - avg_orders) / avg_orders)  BETWEEN -0.2 AND 0 THEN 1        ELSE 0    END as admin_customers_score_orders,CASE        when ((1 / (c_stats.full_year_or_subscription / count(c_stats.id_order)) - avg_between_orders_frequency) / (avg_between_orders_frequency))  > 1 THEN 5        when ((1 / (c_stats.full_year_or_subscription / count(c_stats.id_order)) - avg_between_orders_frequency) / (avg_between_orders_frequency))  BETWEEN 0.6 AND 1 THEN 4        when ((1 / (c_stats.full_year_or_subscription / count(c_stats.id_order)) - avg_between_orders_frequency) / (avg_between_orders_frequency))  BETWEEN 0.2 AND 0.6 THEN 3        when ((1 / (c_stats.full_year_or_subscription / count(c_stats.id_order)) - avg_between_orders_frequency) / (avg_between_orders_frequency))  BETWEEN 0 AND 0.2 THEN 2        when ((1 / (c_stats.full_year_or_subscription / count(c_stats.id_order)) - avg_between_orders_frequency) / (avg_between_orders_frequency))  BETWEEN -0.2 AND 0 THEN 1        ELSE 0    END as admin_customers_score_frequency,CASE        when ((avg(total_paid_tax_excl) - avg_total_paid) / avg_total_paid)  > 1 THEN 5        when ((avg(total_paid_tax_excl) - avg_total_paid) / avg_total_paid)  BETWEEN 0.6 AND 1 THEN 4        when ((avg(total_paid_tax_excl) - avg_total_paid) / avg_total_paid)  BETWEEN 0.2 AND 0.6 THEN 3        when ((avg(total_paid_tax_excl) - avg_total_paid) / avg_total_paid)  BETWEEN 0 AND 0.2 THEN 2        when ((avg(total_paid_tax_excl) - avg_total_paid) / avg_total_paid)  BETWEEN -0.2 AND 0 THEN 1        ELSE 0    END as admin_customers_score_total_paid,CASE        when  ((LEAST(2, ((count(id_order) - avg_orders) / avg_orders))        + (IF(count(id_order) <= 1,        0,        LEAST(2, ((1 / (c_stats.full_year_or_subscription / count(c_stats.id_order)) - avg_between_orders_frequency) / (avg_between_orders_frequency)))        + LEAST(2, (avg(total_paid_tax_excl) - avg_total_paid) / avg_total_paid))))/3) > 1 THEN 5        when  ((LEAST(2, ((count(id_order) - avg_orders) / avg_orders))        + (IF(count(id_order) <= 1,        0,        LEAST(2, ((1 / (c_stats.full_year_or_subscription / count(c_stats.id_order)) - avg_between_orders_frequency) / (avg_between_orders_frequency)))        + LEAST(2, (avg(total_paid_tax_excl) - avg_total_paid) / avg_total_paid))))/3) BETWEEN 0.6 AND 1 THEN 4        when  ((LEAST(2, ((count(id_order) - avg_orders) / avg_orders))        + (IF(count(id_order) <= 1,        0,        LEAST(2, ((1 / (c_stats.full_year_or_subscription / count(c_stats.id_order)) - avg_between_orders_frequency) / (avg_between_orders_frequency)))        + LEAST(2, (avg(total_paid_tax_excl) - avg_total_paid) / avg_total_paid))))/3) BETWEEN 0.2 AND 0.6 THEN 3        when  ((LEAST(2, ((count(id_order) - avg_orders) / avg_orders))        + (IF(count(id_order) <= 1,        0,        LEAST(2, ((1 / (c_stats.full_year_or_subscription / count(c_stats.id_order)) - avg_between_orders_frequency) / (avg_between_orders_frequency)))        + LEAST(2, (avg(total_paid_tax_excl) - avg_total_paid) / avg_total_paid))))/3) BETWEEN 0 AND 0.2 THEN 2        when  ((LEAST(2, ((count(id_order) - avg_orders) / avg_orders))        + (IF(count(id_order) <= 1,        0,        LEAST(2, ((1 / (c_stats.full_year_or_subscription / count(c_stats.id_order)) - avg_between_orders_frequency) / (avg_between_orders_frequency)))        + LEAST(2, (avg(total_paid_tax_excl) - avg_total_paid) / avg_total_paid))))/3) BETWEEN -0.2 AND 0 THEN 1        ELSE 0    END as admin_customers_score_final
			FROM `pstw42_customer` a 
			
			LEFT JOIN pstw42_gender_lang gl ON (a.id_gender = gl.id_gender AND gl.id_lang = 1)LEFT JOIN pstw42_address amb_address ON amb_address.id_address = (SELECT max(amb_add2.id_address) FROM pstw42_address amb_add2 WHERE amb_add2.deleted=0 AND amb_add2.active=1 AND amb_add2.id_customer is not null AND amb_add2.id_customer != 0 AND amb_add2.id_customer = a.id_customer) LEFT JOIN (select        c.id_customer,            IF((o1.id_order IS NOT NULL                AND os1.logable = 1                AND os1.paid = 1), o1.id_order, NULL) as id_order,            IF((o1.id_order IS NOT NULL                AND os1.logable = 1                AND os1.paid = 1), o1.date_add, NULL) as date_add,            LEAST(datediff(NOW(), c.date_add), datediff(NOW(), date_sub(NOW(), INTERVAL 1 year))) as full_year_or_subscription,            IF((o1.id_order IS NOT NULL                AND os1.logable = 1                AND os1.paid = 1), o1.total_paid_tax_excl, NULL) as total_paid_tax_excl,            averages . *    from        pstw42_customer c    left join pstw42_orders o1 ON c.id_customer = o1.id_customer        AND o1.date_add > date_sub(NOW(), INTERVAL 1 year)    left join pstw42_order_state os1 ON os1.id_order_state = o1.current_state, (select        365 / AVG(o2.nb_orders) as avg_order_period,            AVG(o2.nb_orders) as avg_orders,            AVG(o2.recency) as avg_recency,            SUM(o2.full_year_or_subscription) / SUM(o2.nb_orders) as avg_between_orders_period,            1 / (SUM(o2.full_year_or_subscription) / SUM(o2.nb_orders)) as avg_between_orders_frequency,            SUM(o2.total_paid) / SUM(nb_orders) as avg_total_paid    from        (select        COUNT(o1.id_order) as nb_orders,            MAX(o1.date_add) as date_add_last,            LEAST(datediff(NOW(), c1.date_add), datediff(NOW(), date_sub(NOW(), INTERVAL 1 year))) as full_year_or_subscription,            MIN(o1.date_add) date_add_first,            SUM(o1.total_paid_tax_excl) as total_paid,            datediff(NOW(), MAX(o1.date_add)) as recency    from        pstw42_orders o1    inner join pstw42_order_state os1 ON os1.id_order_state = o1.current_state    inner join pstw42_customer c1 ON c1.id_customer = o1.id_customer    where        os1.logable = 1 AND os1.paid = 1            AND o1.date_add > date_sub(NOW(), INTERVAL 1 year)    GROUP BY o1.id_customer) o2) as averages) c_stats ON c_stats.id_customer=a.id_customer 
			 WHERE 1  AND a.`deleted` = 0  AND `date_add` >= '2019-08-01 0:0:0' AND `date_add` <= '2019-09-30 23:59:59' AND `date_add` >= '2019-08-01 0:0:0' AND `date_add` <= '2019-09-30 23:59:59'
			GROUP BY a.id_customer 
			 ORDER BY `date_add` DESC  LIMIT 0, 50

Je ne peux maintenant plus du tout accèder à la page Clients sans avoir cette erreur.

Une idée quelqu'un?

 

Merci.

Edited by Jesse (see edit history)

Share this post


Link to post
Share on other sites

Normal la colonne `date_add` est ambigue.

Bug 1.7

Vider les cookies afin de supprimer l'option de tri

Share this post


Link to post
Share on other sites

Erreur de ma part je suis en 1.6.

J'ai pu réeaccéder à "Clients" en me reconnectant simplement, mais il m'est quand même impossible d'effectuer un tri par date d'inscription.

Share this post


Link to post
Share on other sites

Cette section de requête SQL "CONCAT('_', '::::'"  ne correspond à rien du code natif de Prestashop.

Tu as donc un module/code tiers qui injecte cette requête.

Sans certitude, je dirais rajouter la filter_key dans ton controller

            'date_add' => array(
                'title' => $this->l('Registration'),
                'type' => 'date',
                'align' => 'text-right',
                'filter_key' => 'a!date_add'
            ),

 

Share this post


Link to post
Share on other sites

Merci pour votre retour, pouvez-vous svp me préciser dans quel controller?
 

Share this post


Link to post
Share on other sites

Celui qui génére l'erreur !! Probablement AdminCustomersController.php ou son override

Share this post


Link to post
Share on other sites

Tous ses fichiers en sont à l'origine;

DbCore->displayError - [line 425 - classes/db/Db.php] - [1 Arguments]

DbCore->query - [line 643 - classes/db/Db.php] - [1 Arguments]

DbCore->executeS - [line 3238 - classes/controller/AdminController.php] - [3 Arguments]

AdminControllerCore->getList - [line 228 - controllers/admin/AdminCustomersController.php] - [6 Arguments]

AdminCustomersControllerCore->getList - [line 2364 - classes/controller/AdminController.php] - [1 Arguments]

AdminControllerCore->renderList - [line 330 - controllers/admin/AdminCustomersController.php]

AdminCustomersControllerCore->renderList - [line 2065 - classes/controller/AdminController.php]

AdminControllerCore->initContent - [line 209 - controllers/admin/AdminCustomersController.php]

AdminCustomersControllerCore->initContent - [line 189 - classes/controller/Controller.php]

ControllerCore->run - [line 335 - override/classes/Dispatcher.php]

Dispatcher->dispatch_16 - [line 107 - override/classes/Dispatcher.php]

Dispatcher->dispatch - [line 58 - admin/index.php]

Share this post


Link to post
Share on other sites

Il manque surtout le message d'erreur lui-même entre ces 2 éléments:

image.png.1d1e19d7cb3a006dce50d913cfa8b288.png

Une copie d'écran serait plus simple

Share this post


Link to post
Share on other sites

Je m'appelle Angelina Jolie

override/classes/Dispatcher.php

 

il y a 17 minutes, Jesse a dit :

Tous ses fichiers en sont à l'origine

 

Share this post


Link to post
Share on other sites

J'ai l'erreur suivante;

Parse error: syntax error, unexpected ''date_add'' (T_CONSTANT_ENCAPSED_STRING), expecting function (T_FUNCTION) in /home/www//prestashop/override/classes/Dispatcher.php on line 13

Parse error: syntax error, unexpected ''date_add'' (T_CONSTANT_ENCAPSED_STRING), expecting function (T_FUNCTION) in /home/www/webdsite/prestashop/override/classes/Dispatcher.php on line 13 

 

Edited by Jesse (see edit history)

Share this post


Link to post
Share on other sites

J'abandonne.

Tu ne veux pas nous dire ce qu'il est nécessaire de savoir

Tu ne lis pas un mot des réponses

 

Share this post


Link to post
Share on other sites

J'ai lu toutes vos réponses et fourni les éléments ainsi qu'une capture, l'erreur que je viens de vous joindre résulte de l'insertion de la filter_key dans dispatcher.php

J'ai raté quelque chose? 😦

Share this post


Link to post
Share on other sites

Y a quoi dans cet override ? /home/www//prestashop/override/classes/Dispatcher.php

Le pb vient de ce fichier

Share this post


Link to post
Share on other sites

Capture d’écran 2019-09-03 à 14.33.28.png

 

<?php
/**
 * Page Cache powered by Jpresta (jpresta . com)
 *
 *    @author    Jpresta
 *    @copyright Jpresta
 *    @license   You are just allowed to modify this copy for your own use. You must not redistribute it. License
 *               is permitted for one Prestashop instance only but you can install it on your test instances.
 */
class Dispatcher extends DispatcherCore
{
    /*
    * module: pagecache
    * date: 2017-11-16 17:20:37
    * version: 4.09
    */
    private static $_is_page_cache_active = -1;
    /*
    * module: pagecache
    * date: 2017-11-16 17:20:37
    * version: 4.09
    */
    public $page_cache_start_time = -1;
    /*
    * module: pagecache
    * date: 2017-11-16 17:20:37
    * version: 4.09
    */
    private static function _isPageCacheActive()
    {
        if (self::$_is_page_cache_active == -1)
        {
            if (file_exists(dirname(__FILE__).'/../../modules/pagecache/pagecache.php'))
            {
                require_once(dirname(__FILE__).'/../../modules/pagecache/pagecache.php');
                self::$_is_page_cache_active = Module::isEnabled('pagecache');
            } else {
                Logger::addLog('Page cache has not been well uninstalled, please, remove manually the following functions in file '.__FILE__.': _isPageCacheActive(), dispatch(), dispatch_15() and dispatch_16(). If you need help contact our support.', 4);
                return false;
            }
        }
        return self::$_is_page_cache_active;
    }
    /*
    * module: pagecache
    * date: 2017-11-16 17:20:37
    * version: 4.09
    */

    public function getControllerFromURL($url, $id_shop = null) {
        $controller = false;
        $is_fc_module = false;
        if (isset(Context::getContext()->shop) && $id_shop === null)
            $id_shop = (int)Context::getContext()->shop->id;
        $query = parse_url($url, PHP_URL_QUERY);
        if ($query) {
            $query = html_entity_decode($query);
            $keyvaluepairs = explode('&', $query);
            if ($keyvaluepairs !== false) {
                foreach($keyvaluepairs as $keyvaluepair) {
                    if (strstr($keyvaluepair, '=') !== false) {
                        list($key, $value) = explode('=', $keyvaluepair);
                        if (strcmp('controller', $key) === 0) {
                            $controller = $value;
                        }
                        elseif (strcmp('fc', $key) === 0) {
                            $is_fc_module = strcmp('module', $value) !== false;
                        }
                    }
                }
            }
        }
        if (!Validate::isControllerName($controller))
            $controller = false;
        if (!$controller && $this->use_routes) {
            $url_without_lang = $url;
            if (isset($this->routes[$id_shop][Context::getContext()->language->id])) {
                foreach ($this->routes[$id_shop][Context::getContext()->language->id] as $route) {
                    if (preg_match($route['regexp'], $url_without_lang, $m)) {
                        $controller = $route['controller'] ? $route['controller'] : false;
                        if (preg_match('#module-([a-z0-9_-]+)-([a-z0-9_]+)$#i', $controller, $m)) {
                            $controller = $m[2];
                        }
                        if ($is_fc_module)
                            $controller = false;
                        break;
                    }
                }
            }
            if (!$controller && Tools::strlen($url_without_lang) == 0) {
                $controller = 'index';
            }
            elseif ($controller == 'index' || preg_match('/^\/index.php(?:\?.*)?$/', $url_without_lang)) {
                if ($is_fc_module) {
                    $controller = false;
                }
            }
        }
        return $controller;
    }
    /*
    * module: pagecache
    * date: 2017-11-16 17:20:37
    * version: 4.09
    */
    public function dispatch() {
        if (Tools::version_compare(_PS_VERSION_,'1.6','>=')) {
            $this->dispatch_16();
        } else {
            $this->dispatch_15();
        }
    }
    /*
    * module: pagecache
    * date: 2017-11-16 17:20:37
    * version: 4.09
    */
    private function dispatch_15()
    {
        $this->getController();
        if (!$this->controller)
            $this->controller = $this->default_controller;
        $this->page_cache_start_time = microtime(true);
        if ($this->_isPageCacheActive())
        {
            $pre_display_html = PageCache::preDisplayStats();
            if (PageCache::displayCacheIfExists())
            {
                PageCache::displayStats(true, $pre_display_html);
                return;
            }
        }
        $controller_class = '';
        switch ($this->front_controller)
        {
            case self::FC_FRONT :
                $controllers = Dispatcher::getControllers(array(_PS_FRONT_CONTROLLER_DIR_, _PS_OVERRIDE_DIR_.'controllers/front/'));
                $controllers['index'] = 'IndexController';
                if (isset($controllers['auth']))
                    $controllers['authentication'] = $controllers['auth'];
                if (isset($controllers['compare']))
                    $controllers['productscomparison'] = $controllers['compare'];
                if (isset($controllers['contact']))
                    $controllers['contactform'] = $controllers['contact'];
                if (!isset($controllers[Tools::strtolower($this->controller)]))
                    $this->controller = $this->controller_not_found;
                $controller_class = $controllers[Tools::strtolower($this->controller)];
                $params_hook_action_dispatcher = array('controller_type' => self::FC_FRONT, 'controller_class' => $controller_class, 'is_module' => 0);
            break;
            case self::FC_MODULE :
                $module_name = Validate::isModuleName(Tools::getValue('module')) ? Tools::getValue('module') : '';
                $module = Module::getInstanceByName($module_name);
                $controller_class = 'PageNotFoundController';
                if (Validate::isLoadedObject($module) && $module->active)
                {
                    $controllers = Dispatcher::getControllers(_PS_MODULE_DIR_.$module_name.'/controllers/front/');
                    if (isset($controllers[Tools::strtolower($this->controller)]))
                    {
                        include_once(_PS_MODULE_DIR_.$module_name.'/controllers/front/'.$this->controller.'.php');
                        $controller_class = $module_name.$this->controller.'ModuleFrontController';
                    }
                }
                $params_hook_action_dispatcher = array('controller_type' => self::FC_FRONT, 'controller_class' => $controller_class, 'is_module' => 1);
            break;
            case self::FC_ADMIN :
                $tab = Tab::getInstanceFromClassName($this->controller);
                $retrocompatibility_admin_tab = null;
                if ($tab->module)
                {
                    if (file_exists(_PS_MODULE_DIR_.$tab->module.'/'.$tab->class_name.'.php'))
                        $retrocompatibility_admin_tab = _PS_MODULE_DIR_.$tab->module.'/'.$tab->class_name.'.php';
                    else
                    {
                        $controllers = Dispatcher::getControllers(_PS_MODULE_DIR_.$tab->module.'/controllers/admin/');
                        if (!isset($controllers[Tools::strtolower($this->controller)]))
                        {
                            $this->controller = $this->controller_not_found;
                            $controller_class = 'AdminNotFoundController';
                        }
                        else
                        {
                            include_once(_PS_MODULE_DIR_.$tab->module.'/controllers/admin/'.$controllers[Tools::strtolower($this->controller)].'.php');
                            $controller_class = $controllers[Tools::strtolower($this->controller)].(strpos($controllers[Tools::strtolower($this->controller)], 'Controller') ? '' : 'Controller');
                        }
                    }
                    $params_hook_action_dispatcher = array('controller_type' => self::FC_ADMIN, 'controller_class' => $controller_class, 'is_module' => 1);
                }
                else
                {
                    $controllers = Dispatcher::getControllers(array(_PS_ADMIN_DIR_.'/tabs/', _PS_ADMIN_CONTROLLER_DIR_, _PS_OVERRIDE_DIR_.'controllers/admin/'));
                    if (!isset($controllers[Tools::strtolower($this->controller)]))
                        $this->controller = $this->controller_not_found;
                    $controller_class = $controllers[Tools::strtolower($this->controller)];
                    $params_hook_action_dispatcher = array('controller_type' => self::FC_ADMIN, 'controller_class' => $controller_class, 'is_module' => 0);
                    if (file_exists(_PS_ADMIN_DIR_.'/tabs/'.$controller_class.'.php'))
                        $retrocompatibility_admin_tab = _PS_ADMIN_DIR_.'/tabs/'.$controller_class.'.php';
                }
                if ($retrocompatibility_admin_tab)
                {
                    include_once($retrocompatibility_admin_tab);
                    include_once(_PS_ADMIN_DIR_.'/functions.php');
                    runAdminTab($this->controller, !empty($_REQUEST['ajaxMode']));
                    return;
                }
            break;
            default :
                throw new PrestaShopException('Bad front controller chosen');
        }
        try
        {
            $controller = Controller::getController($controller_class);
            if (isset($params_hook_action_dispatcher))
                Hook::exec('actionDispatcher', $params_hook_action_dispatcher);
            $controller->run();
            if ($this->_isPageCacheActive())
            {
                PageCache::displayStats(false, $pre_display_html);
            }
        }
        catch (PrestaShopException $e)
        {
            $e->displayMessage();
        }
    }
    /*
    * module: pagecache
    * date: 2017-11-16 17:20:37
    * version: 4.09
    */
    private function dispatch_16()
    {
        $controller_class = '';
        $this->getController();
        if (!$this->controller) {
            if (!method_exists($this, 'useDefaultController'))
                $this->controller = $this->default_controller;
            else
                $this->controller = $this->useDefaultController();
        }
        $this->page_cache_start_time = microtime(true);
        if ($this->_isPageCacheActive())
        {
            $pre_display_html = PageCache::preDisplayStats();
            if (PageCache::displayCacheIfExists())
            {
                PageCache::displayStats(true, $pre_display_html);
                return;
            }
        }
        switch ($this->front_controller)
        {
            case self::FC_FRONT :
                $controllers = Dispatcher::getControllers(array(_PS_FRONT_CONTROLLER_DIR_, _PS_OVERRIDE_DIR_.'controllers/front/'));
                $controllers['index'] = 'IndexController';
                if (isset($controllers['auth']))
                    $controllers['authentication'] = $controllers['auth'];
                if (isset($controllers['compare']))
                    $controllers['productscomparison'] = $controllers['compare'];
                if (isset($controllers['contact']))
                    $controllers['contactform'] = $controllers['contact'];
                if (!isset($controllers[Tools::strtolower($this->controller)]))
                    $this->controller = $this->controller_not_found;
                $controller_class = $controllers[Tools::strtolower($this->controller)];
                $params_hook_action_dispatcher = array('controller_type' => self::FC_FRONT, 'controller_class' => $controller_class, 'is_module' => 0);
                break;
            case self::FC_MODULE :
                $module_name = Validate::isModuleName(Tools::getValue('module')) ? Tools::getValue('module') : '';
                $module = Module::getInstanceByName($module_name);
                $controller_class = 'PageNotFoundController';
                if (Validate::isLoadedObject($module) && $module->active)
                {
                    $controllers = Dispatcher::getControllers(_PS_MODULE_DIR_.$module_name.'/controllers/front/');
                    if (isset($controllers[Tools::strtolower($this->controller)]))
                    {
                        include_once(_PS_MODULE_DIR_.$module_name.'/controllers/front/'.$this->controller.'.php');
                        $controller_class = $module_name.$this->controller.'ModuleFrontController';
                    }
                }
                $params_hook_action_dispatcher = array('controller_type' => self::FC_FRONT, 'controller_class' => $controller_class, 'is_module' => 1);
                break;
            case self::FC_ADMIN :
                if ($this->use_default_controller && !Tools::getValue('token') && Validate::isLoadedObject(Context::getContext()->employee) && Context::getContext()->employee->isLoggedBack())
                    Tools::redirectAdmin('index.php?controller='.$this->controller.'&token='.Tools::getAdminTokenLite($this->controller));
                $tab = Tab::getInstanceFromClassName($this->controller, Configuration::get('PS_LANG_DEFAULT'));
                $retrocompatibility_admin_tab = null;
                if ($tab->module)
                {
                    if (file_exists(_PS_MODULE_DIR_.$tab->module.'/'.$tab->class_name.'.php'))
                        $retrocompatibility_admin_tab = _PS_MODULE_DIR_.$tab->module.'/'.$tab->class_name.'.php';
                    else
                    {
                        $controllers = Dispatcher::getControllers(_PS_MODULE_DIR_.$tab->module.'/controllers/admin/');
                        if (!isset($controllers[Tools::strtolower($this->controller)]))
                        {
                            $this->controller = $this->controller_not_found;
                            $controller_class = 'AdminNotFoundController';
                        }
                        else
                        {
                            include_once(_PS_MODULE_DIR_.$tab->module.'/controllers/admin/'.$controllers[Tools::strtolower($this->controller)].'.php');
                            $controller_class = $controllers[Tools::strtolower($this->controller)].(strpos($controllers[Tools::strtolower($this->controller)], 'Controller') ? '' : 'Controller');
                        }
                    }
                    $params_hook_action_dispatcher = array('controller_type' => self::FC_ADMIN, 'controller_class' => $controller_class, 'is_module' => 1);
                }
                else
                {
                    $controllers = Dispatcher::getControllers(array(_PS_ADMIN_DIR_.'/tabs/', _PS_ADMIN_CONTROLLER_DIR_, _PS_OVERRIDE_DIR_.'controllers/admin/'));
                    if (!isset($controllers[Tools::strtolower($this->controller)]))
                    {
                        if (Validate::isLoadedObject($tab) && $tab->id_parent == 0 && ($tabs = Tab::getTabs(Context::getContext()->language->id, $tab->id)) && isset($tabs[0]))
                            Tools::redirectAdmin(Context::getContext()->link->getAdminLink($tabs[0]['class_name']));
                        $this->controller = $this->controller_not_found;
                    }
                    $controller_class = $controllers[Tools::strtolower($this->controller)];
                    $params_hook_action_dispatcher = array('controller_type' => self::FC_ADMIN, 'controller_class' => $controller_class, 'is_module' => 0);
                    if (file_exists(_PS_ADMIN_DIR_.'/tabs/'.$controller_class.'.php'))
                        $retrocompatibility_admin_tab = _PS_ADMIN_DIR_.'/tabs/'.$controller_class.'.php';
                }
                if ($retrocompatibility_admin_tab)
                {
                    include_once($retrocompatibility_admin_tab);
                    include_once(_PS_ADMIN_DIR_.'/functions.php');
                    runAdminTab($this->controller, !empty($_REQUEST['ajaxMode']));
                    return;
                }
                break;
            default :
                throw new PrestaShopException('Bad front controller chosen');
        }
        try
        {
            $controller = Controller::getController($controller_class);
            if (isset($params_hook_action_dispatcher))
                Hook::exec('actionDispatcher', $params_hook_action_dispatcher);
            $controller->run();
            if ($this->_isPageCacheActive())
            {
                PageCache::displayStats(false, $pre_display_html);
            }
        }
        catch (PrestaShopException $e)
        {
            $e->displayMessage();
        }
    }
}

 

Edited by Jesse (see edit history)

Share this post


Link to post
Share on other sites

Oui donc tu crois aussi que je m'appelle Angelina Jolie !

Tu dis que rien n'est changé dans le code, ton dump montre qu'au moins dispatcher est changé

Tu as un module contenu tiers qui bricolle ton AdminCustomers.php, preuve, ceci n'existe dans aucune version de prestashop:

CONCAT('_', '::::', (SELECT COUNT(*) FROM pstw42_customer_group cg WHERE cg.id_customer=a.id_customer)) as _,'fetchGroupsFromCustomerId' as __method,a.id_customer as __id,(SELECT max(amb_add2.id_address) FROM pstw42_address amb_add2 WHERE amb_add2.deleted=0 AND amb_add2.active=1 AND amb_add2.id_customer is not null AND amb_add2.id_customer != 0 AND amb_add2.id_customer = a.id_customer) as admin_customers_default_billing_address_address_id,'admin_customers_default_billing_address' as admin_customers_default_billing_address,CONCAT(amb_address.phone, ' ', amb_address.phone_mobile) as admin_customers_phones,'fetchOrdersFromCustomerId' as ___method,a.id_customer as ___id,CONCAT('__', '::::', IFNULL((SELECT COUNT(id_order) FROM pstw42_orders acoc_o INNER JOIN pstw42_order_state acoc_os ON acoc_o.current_state = acoc_os.id_order_state WHERE acoc_os.logable=1 and acoc_o.id_customer = a.id_customer),0)) as __,'fetchOrderedCartsFromCustomerId' as ____method,a.id_customer as ____id,CONCAT('___', '::::', IFNULL((SELECT COUNT(acoc_c.id_cart) FROM pstw42_cart acoc_c LEFT JOIN pstw42_orders acoc_o ON acoc_o.id_cart=acoc_c.id_cart WHERE acoc_c.id_customer = a.id_customer AND acoc_o.id_order IS NOT NULL), 0)) as ___,a.birthday as admin_customers_birthday,(FLOOR(DATEDIFF(CURDATE(), a.birthday)/365)) as admin_customers_age,(SELECT iso_code FROM pstw42_lang acl_l WHERE acl_l.id_lang=(SELECT o.id_lang FROM pstw42_orders o WHERE o.id_customer=a.id_customer ORDER BY id_order DESC LIMIT 1)) as admin_customers_language,CONCAT('____', '::::', a.note) as ____,(SELECT MAX(invoice_date) FROM pstw42_orders aclo_o INNER JOIN pstw42_order_state aclo_os ON aclo_o.current_state = aclo_os.id_order_state WHERE aclo_os.logable=1 AND aclo_o.id_customer=a.id_customer) as admin_customers_last_order,(SELECT SUM(total_products) FROM pstw42_orders acth_o INNER JOIN pstw42_order_state acth_os ON acth_o.current_state = acth_os.id_order_state WHERE acth_os.logable=1 AND acth_o.id_customer=a.id_customer) as admin_customers_total_ht,'fetchCartRulesFromCustomerId' as ______method,a.id_customer as ______id,CONCAT('_____', '::::', (SELECT COUNT(id_cart_rule) FROM pstw42_cart_rule acdl_cr WHERE acdl_cr.id_customer = a.id_customer)) as _____,CONCAT('______', '::::', (SELECT CONCAT(UCASE(LEFT(acct_ct.status, 1)), SUBSTRING(acct_ct.status, 2)) FROM pstw42_customer_thread acct_ct WHERE acct_ct.id_customer=a.id_customer ORDER BY acct_ct.id_customer_thread DESC LIMIT 1)) as ______,'AdminCustomerThreads' as _______controller,CONCAT('id_customer_thread=', (SELECT MAX(id_customer_thread) FROM pstw42_customer_thread acct_ct WHERE acct_ct.id_customer=a.id_customer) , '&viewcustomer_thread') as _______params,'AdminCustomerThreads' as _______translator, CASE        when ((count(id_order) - avg_orders) / avg_orders)  > 1 THEN 5        when ((count(id_order) - avg_orders) / avg_orders)  BETWEEN 0.6 AND 1 THEN 4        when ((count(id_order) - avg_orders) / avg_orders)  BETWEEN 0.2 AND 0.6 THEN 3        when ((count(id_order) - avg_orders) / avg_orders)  BETWEEN 0 AND 0.2 THEN 2        when ((count(id_order) - avg_orders) / avg_orders)  BETWEEN -0.2 AND 0 THEN 1        ELSE 0    END as admin_customers_score_orders,CASE        when ((1 / (c_stats.full_year_or_subscription / count(c_stats.id_order)) - avg_between_orders_frequency) / (avg_between_orders_frequency))  > 1 THEN 5        when ((1 / (c_stats.full_year_or_subscription / count(c_stats.id_order)) - avg_between_orders_frequency) / (avg_between_orders_frequency))  BETWEEN 0.6 AND 1 THEN 4        when ((1 / (c_stats.full_year_or_subscription / count(c_stats.id_order)) - avg_between_orders_frequency) / (avg_between_orders_frequency))  BETWEEN 0.2 AND 0.6 THEN 3        when ((1 / (c_stats.full_year_or_subscription / count(c_stats.id_order)) - avg_between_orders_frequency) / (avg_between_orders_frequency))  BETWEEN 0 AND 0.2 THEN 2        when ((1 / (c_stats.full_year_or_subscription / count(c_stats.id_order)) - avg_between_orders_frequency) / (avg_between_orders_frequency))  BETWEEN -0.2 AND 0 THEN 1        ELSE 0    END as admin_customers_score_frequency,CASE        when ((avg(total_paid_tax_excl) - avg_total_paid) / avg_total_paid)  > 1 THEN 5        when ((avg(total_paid_tax_excl) - avg_total_paid) / avg_total_paid)  BETWEEN 0.6 AND 1 THEN 4        when ((avg(total_paid_tax_excl) - avg_total_paid) / avg_total_paid)  BETWEEN 0.2 AND 0.6 THEN 3        when ((avg(total_paid_tax_excl) - avg_total_paid) / avg_total_paid)  BETWEEN 0 AND 0.2 THEN 2        when ((avg(total_paid_tax_excl) - avg_total_paid) / avg_total_paid)  BETWEEN -0.2 AND 0 THEN 1        ELSE 0    END as admin_customers_score_total_paid,CASE        when  ((LEAST(2, ((count(id_order) - avg_orders) / avg_orders))        + (IF(count(id_order) <= 1,        0,        LEAST(2, ((1 / (c_stats.full_year_or_subscription / count(c_stats.id_order)) - avg_between_orders_frequency) / (avg_between_orders_frequency)))        + LEAST(2, (avg(total_paid_tax_excl) - avg_total_paid) / avg_total_paid))))/3) > 1 THEN 5        when  ((LEAST(2, ((count(id_order) - avg_orders) / avg_orders))        + (IF(count(id_order) <= 1,        0,        LEAST(2, ((1 / (c_stats.full_year_or_subscription / count(c_stats.id_order)) - avg_between_orders_frequency) / (avg_between_orders_frequency)))        + LEAST(2, (avg(total_paid_tax_excl) - avg_total_paid) / avg_total_paid))))/3) BETWEEN 0.6 AND 1 THEN 4        when  ((LEAST(2, ((count(id_order) - avg_orders) / avg_orders))        + (IF(count(id_order) <= 1,        0,        LEAST(2, ((1 / (c_stats.full_year_or_subscription / count(c_stats.id_order)) - avg_between_orders_frequency) / (avg_between_orders_frequency)))        + LEAST(2, (avg(total_paid_tax_excl) - avg_total_paid) / avg_total_paid))))/3) BETWEEN 0.2 AND 0.6 THEN 3        when  ((LEAST(2, ((count(id_order) - avg_orders) / avg_orders))        + (IF(count(id_order) <= 1,        0,        LEAST(2, ((1 / (c_stats.full_year_or_subscription / count(c_stats.id_order)) - avg_between_orders_frequency) / (avg_between_orders_frequency)))        + LEAST(2, (avg(total_paid_tax_excl) - avg_total_paid) / avg_total_paid))))/3) BETWEEN 0 AND 0.2 THEN 2        when  ((LEAST(2, ((count(id_order) - avg_orders) / avg_orders))        + (IF(count(id_order) <= 1,        0,        LEAST(2, ((1 / (c_stats.full_year_or_subscription / count(c_stats.id_order)) - avg_between_orders_frequency) / (avg_between_orders_frequency)))        + LEAST(2, (avg(total_paid_tax_excl) - avg_total_paid) / avg_total_paid))))/3) BETWEEN -0.2 AND 0 THEN 1        ELSE 0    END as admin_customers_score_final

ici ton code tape carrément dans une autre base de données (amb_add2)!

Share this post


Link to post
Share on other sites

Un module de cache, et pour l'admin en plus... On oublie^^

Share this post


Link to post
Share on other sites
On 9/3/2019 at 2:35 PM, doekia said:

Oui donc tu crois aussi que je m'appelle Angelina Jolie !

Tu dis que rien n'est changé dans le code, ton dump montre qu'au moins dispatcher est changé

Tu as un module contenu tiers qui bricolle ton AdminCustomers.php, preuve, ceci n'existe dans aucune version de prestashop:


CONCAT('_', '::::', (SELECT COUNT(*) FROM pstw42_customer_group cg WHERE cg.id_customer=a.id_customer)) as _,'fetchGroupsFromCustomerId' as __method,a.id_customer as __id,(SELECT max(amb_add2.id_address) FROM pstw42_address amb_add2 WHERE amb_add2.deleted=0 AND amb_add2.active=1 AND amb_add2.id_customer is not null AND amb_add2.id_customer != 0 AND amb_add2.id_customer = a.id_customer) as admin_customers_default_billing_address_address_id,'admin_customers_default_billing_address' as admin_customers_default_billing_address,CONCAT(amb_address.phone, ' ', amb_address.phone_mobile) as admin_customers_phones,'fetchOrdersFromCustomerId' as ___method,a.id_customer as ___id,CONCAT('__', '::::', IFNULL((SELECT COUNT(id_order) FROM pstw42_orders acoc_o INNER JOIN pstw42_order_state acoc_os ON acoc_o.current_state = acoc_os.id_order_state WHERE acoc_os.logable=1 and acoc_o.id_customer = a.id_customer),0)) as __,'fetchOrderedCartsFromCustomerId' as ____method,a.id_customer as ____id,CONCAT('___', '::::', IFNULL((SELECT COUNT(acoc_c.id_cart) FROM pstw42_cart acoc_c LEFT JOIN pstw42_orders acoc_o ON acoc_o.id_cart=acoc_c.id_cart WHERE acoc_c.id_customer = a.id_customer AND acoc_o.id_order IS NOT NULL), 0)) as ___,a.birthday as admin_customers_birthday,(FLOOR(DATEDIFF(CURDATE(), a.birthday)/365)) as admin_customers_age,(SELECT iso_code FROM pstw42_lang acl_l WHERE acl_l.id_lang=(SELECT o.id_lang FROM pstw42_orders o WHERE o.id_customer=a.id_customer ORDER BY id_order DESC LIMIT 1)) as admin_customers_language,CONCAT('____', '::::', a.note) as ____,(SELECT MAX(invoice_date) FROM pstw42_orders aclo_o INNER JOIN pstw42_order_state aclo_os ON aclo_o.current_state = aclo_os.id_order_state WHERE aclo_os.logable=1 AND aclo_o.id_customer=a.id_customer) as admin_customers_last_order,(SELECT SUM(total_products) FROM pstw42_orders acth_o INNER JOIN pstw42_order_state acth_os ON acth_o.current_state = acth_os.id_order_state WHERE acth_os.logable=1 AND acth_o.id_customer=a.id_customer) as admin_customers_total_ht,'fetchCartRulesFromCustomerId' as ______method,a.id_customer as ______id,CONCAT('_____', '::::', (SELECT COUNT(id_cart_rule) FROM pstw42_cart_rule acdl_cr WHERE acdl_cr.id_customer = a.id_customer)) as _____,CONCAT('______', '::::', (SELECT CONCAT(UCASE(LEFT(acct_ct.status, 1)), SUBSTRING(acct_ct.status, 2)) FROM pstw42_customer_thread acct_ct WHERE acct_ct.id_customer=a.id_customer ORDER BY acct_ct.id_customer_thread DESC LIMIT 1)) as ______,'AdminCustomerThreads' as _______controller,CONCAT('id_customer_thread=', (SELECT MAX(id_customer_thread) FROM pstw42_customer_thread acct_ct WHERE acct_ct.id_customer=a.id_customer) , '&viewcustomer_thread') as _______params,'AdminCustomerThreads' as _______translator, CASE        when ((count(id_order) - avg_orders) / avg_orders)  > 1 THEN 5        when ((count(id_order) - avg_orders) / avg_orders)  BETWEEN 0.6 AND 1 THEN 4        when ((count(id_order) - avg_orders) / avg_orders)  BETWEEN 0.2 AND 0.6 THEN 3        when ((count(id_order) - avg_orders) / avg_orders)  BETWEEN 0 AND 0.2 THEN 2        when ((count(id_order) - avg_orders) / avg_orders)  BETWEEN -0.2 AND 0 THEN 1        ELSE 0    END as admin_customers_score_orders,CASE        when ((1 / (c_stats.full_year_or_subscription / count(c_stats.id_order)) - avg_between_orders_frequency) / (avg_between_orders_frequency))  > 1 THEN 5        when ((1 / (c_stats.full_year_or_subscription / count(c_stats.id_order)) - avg_between_orders_frequency) / (avg_between_orders_frequency))  BETWEEN 0.6 AND 1 THEN 4        when ((1 / (c_stats.full_year_or_subscription / count(c_stats.id_order)) - avg_between_orders_frequency) / (avg_between_orders_frequency))  BETWEEN 0.2 AND 0.6 THEN 3        when ((1 / (c_stats.full_year_or_subscription / count(c_stats.id_order)) - avg_between_orders_frequency) / (avg_between_orders_frequency))  BETWEEN 0 AND 0.2 THEN 2        when ((1 / (c_stats.full_year_or_subscription / count(c_stats.id_order)) - avg_between_orders_frequency) / (avg_between_orders_frequency))  BETWEEN -0.2 AND 0 THEN 1        ELSE 0    END as admin_customers_score_frequency,CASE        when ((avg(total_paid_tax_excl) - avg_total_paid) / avg_total_paid)  > 1 THEN 5        when ((avg(total_paid_tax_excl) - avg_total_paid) / avg_total_paid)  BETWEEN 0.6 AND 1 THEN 4        when ((avg(total_paid_tax_excl) - avg_total_paid) / avg_total_paid)  BETWEEN 0.2 AND 0.6 THEN 3        when ((avg(total_paid_tax_excl) - avg_total_paid) / avg_total_paid)  BETWEEN 0 AND 0.2 THEN 2        when ((avg(total_paid_tax_excl) - avg_total_paid) / avg_total_paid)  BETWEEN -0.2 AND 0 THEN 1        ELSE 0    END as admin_customers_score_total_paid,CASE        when  ((LEAST(2, ((count(id_order) - avg_orders) / avg_orders))        + (IF(count(id_order) <= 1,        0,        LEAST(2, ((1 / (c_stats.full_year_or_subscription / count(c_stats.id_order)) - avg_between_orders_frequency) / (avg_between_orders_frequency)))        + LEAST(2, (avg(total_paid_tax_excl) - avg_total_paid) / avg_total_paid))))/3) > 1 THEN 5        when  ((LEAST(2, ((count(id_order) - avg_orders) / avg_orders))        + (IF(count(id_order) <= 1,        0,        LEAST(2, ((1 / (c_stats.full_year_or_subscription / count(c_stats.id_order)) - avg_between_orders_frequency) / (avg_between_orders_frequency)))        + LEAST(2, (avg(total_paid_tax_excl) - avg_total_paid) / avg_total_paid))))/3) BETWEEN 0.6 AND 1 THEN 4        when  ((LEAST(2, ((count(id_order) - avg_orders) / avg_orders))        + (IF(count(id_order) <= 1,        0,        LEAST(2, ((1 / (c_stats.full_year_or_subscription / count(c_stats.id_order)) - avg_between_orders_frequency) / (avg_between_orders_frequency)))        + LEAST(2, (avg(total_paid_tax_excl) - avg_total_paid) / avg_total_paid))))/3) BETWEEN 0.2 AND 0.6 THEN 3        when  ((LEAST(2, ((count(id_order) - avg_orders) / avg_orders))        + (IF(count(id_order) <= 1,        0,        LEAST(2, ((1 / (c_stats.full_year_or_subscription / count(c_stats.id_order)) - avg_between_orders_frequency) / (avg_between_orders_frequency)))        + LEAST(2, (avg(total_paid_tax_excl) - avg_total_paid) / avg_total_paid))))/3) BETWEEN 0 AND 0.2 THEN 2        when  ((LEAST(2, ((count(id_order) - avg_orders) / avg_orders))        + (IF(count(id_order) <= 1,        0,        LEAST(2, ((1 / (c_stats.full_year_or_subscription / count(c_stats.id_order)) - avg_between_orders_frequency) / (avg_between_orders_frequency)))        + LEAST(2, (avg(total_paid_tax_excl) - avg_total_paid) / avg_total_paid))))/3) BETWEEN -0.2 AND 0 THEN 1        ELSE 0    END as admin_customers_score_final

ici ton code tape carrément dans une autre base de données (amb_add2)!

J'ai simplement tenu compte du fait que vous pointiez le doigt sur dispatcher.php plutôt que la blague à propos d'Angelina Jolie.

Ce à quoi j'ai répondu que j'avais essayé d'intégrer votre code dans dispatcher.php avec l'erreur reportée...

Je ne vois du coup pas en quoi je ne lis pas les réponses, je fais au mieux avec les éléments que j'ai, et je n'ai jamais dis non plus que rien n'est changé dans le code? Je comprends cependant que vous n'ayez pas forcement la patience à m'aider sur cet aspect.

 

Share this post


Link to post
Share on other sites
On 9/3/2019 at 2:36 PM, Eolia said:

Un module de cache, et pour l'admin en plus... On oublie^^

J'utilise le module Page Cache Ultimate, qui n'est pas supposé toucher à l'admin.

Dois-je simplement effacer cette partie de la requête SQL?

CONCAT('_', '::::', (SELECT COUNT(*) FROM pstw42_customer_group cg WHERE cg.id_customer=a.id_customer)) as _,'fetchGroupsFromCustomerId' as __method,a.id_customer as __id,(SELECT max(amb_add2.id_address) FROM pstw42_address amb_add2 WHERE amb_add2.deleted=0 AND amb_add2.active=1 AND amb_add2.id_customer is not null AND amb_add2.id_customer != 0 AND amb_add2.id_customer = a.id_customer) as admin_customers_default_billing_address_address_id,'admin_customers_default_billing_address' as admin_customers_default_billing_address,CONCAT(amb_address.phone, ' ', amb_address.phone_mobile) as admin_customers_phones,'fetchOrdersFromCustomerId' as ___method,a.id_customer as ___id,CONCAT('__', '::::', IFNULL((SELECT COUNT(id_order) FROM pstw42_orders acoc_o INNER JOIN pstw42_order_state acoc_os ON acoc_o.current_state = acoc_os.id_order_state WHERE acoc_os.logable=1 and acoc_o.id_customer = a.id_customer),0)) as __,'fetchOrderedCartsFromCustomerId' as ____method,a.id_customer as ____id,CONCAT('___', '::::', IFNULL((SELECT COUNT(acoc_c.id_cart) FROM pstw42_cart acoc_c LEFT JOIN pstw42_orders acoc_o ON acoc_o.id_cart=acoc_c.id_cart WHERE acoc_c.id_customer = a.id_customer AND acoc_o.id_order IS NOT NULL), 0)) as ___,a.birthday as admin_customers_birthday,(FLOOR(DATEDIFF(CURDATE(), a.birthday)/365)) as admin_customers_age,(SELECT iso_code FROM pstw42_lang acl_l WHERE acl_l.id_lang=(SELECT o.id_lang FROM pstw42_orders o WHERE o.id_customer=a.id_customer ORDER BY id_order DESC LIMIT 1)) as admin_customers_language,CONCAT('____', '::::', a.note) as ____,(SELECT MAX(invoice_date) FROM pstw42_orders aclo_o INNER JOIN pstw42_order_state aclo_os ON aclo_o.current_state = aclo_os.id_order_state WHERE aclo_os.logable=1 AND aclo_o.id_customer=a.id_customer) as admin_customers_last_order,(SELECT SUM(total_products) FROM pstw42_orders acth_o INNER JOIN pstw42_order_state acth_os ON acth_o.current_state = acth_os.id_order_state WHERE acth_os.logable=1 AND acth_o.id_customer=a.id_customer) as admin_customers_total_ht,'fetchCartRulesFromCustomerId' as ______method,a.id_customer as ______id,CONCAT('_____', '::::', (SELECT COUNT(id_cart_rule) FROM pstw42_cart_rule acdl_cr WHERE acdl_cr.id_customer = a.id_customer)) as _____,CONCAT('______', '::::', (SELECT CONCAT(UCASE(LEFT(acct_ct.status, 1)), SUBSTRING(acct_ct.status, 2)) FROM pstw42_customer_thread acct_ct WHERE acct_ct.id_customer=a.id_customer ORDER BY acct_ct.id_customer_thread DESC LIMIT 1)) as ______,'AdminCustomerThreads' as _______controller,CONCAT('id_customer_thread=', (SELECT MAX(id_customer_thread) FROM pstw42_customer_thread acct_ct WHERE acct_ct.id_customer=a.id_customer) , '&viewcustomer_thread') as _______params,'AdminCustomerThreads' as _______translator, CASE        when ((count(id_order) - avg_orders) / avg_orders)  > 1 THEN 5        when ((count(id_order) - avg_orders) / avg_orders)  BETWEEN 0.6 AND 1 THEN 4        when ((count(id_order) - avg_orders) / avg_orders)  BETWEEN 0.2 AND 0.6 THEN 3        when ((count(id_order) - avg_orders) / avg_orders)  BETWEEN 0 AND 0.2 THEN 2        when ((count(id_order) - avg_orders) / avg_orders)  BETWEEN -0.2 AND 0 THEN 1        ELSE 0    END as admin_customers_score_orders,CASE        when ((1 / (c_stats.full_year_or_subscription / count(c_stats.id_order)) - avg_between_orders_frequency) / (avg_between_orders_frequency))  > 1 THEN 5        when ((1 / (c_stats.full_year_or_subscription / count(c_stats.id_order)) - avg_between_orders_frequency) / (avg_between_orders_frequency))  BETWEEN 0.6 AND 1 THEN 4        when ((1 / (c_stats.full_year_or_subscription / count(c_stats.id_order)) - avg_between_orders_frequency) / (avg_between_orders_frequency))  BETWEEN 0.2 AND 0.6 THEN 3        when ((1 / (c_stats.full_year_or_subscription / count(c_stats.id_order)) - avg_between_orders_frequency) / (avg_between_orders_frequency))  BETWEEN 0 AND 0.2 THEN 2        when ((1 / (c_stats.full_year_or_subscription / count(c_stats.id_order)) - avg_between_orders_frequency) / (avg_between_orders_frequency))  BETWEEN -0.2 AND 0 THEN 1        ELSE 0    END as admin_customers_score_frequency,CASE        when ((avg(total_paid_tax_excl) - avg_total_paid) / avg_total_paid)  > 1 THEN 5        when ((avg(total_paid_tax_excl) - avg_total_paid) / avg_total_paid)  BETWEEN 0.6 AND 1 THEN 4        when ((avg(total_paid_tax_excl) - avg_total_paid) / avg_total_paid)  BETWEEN 0.2 AND 0.6 THEN 3        when ((avg(total_paid_tax_excl) - avg_total_paid) / avg_total_paid)  BETWEEN 0 AND 0.2 THEN 2        when ((avg(total_paid_tax_excl) - avg_total_paid) / avg_total_paid)  BETWEEN -0.2 AND 0 THEN 1        ELSE 0    END as admin_customers_score_total_paid,CASE        when  ((LEAST(2, ((count(id_order) - avg_orders) / avg_orders))        + (IF(count(id_order) <= 1,        0,        LEAST(2, ((1 / (c_stats.full_year_or_subscription / count(c_stats.id_order)) - avg_between_orders_frequency) / (avg_between_orders_frequency)))        + LEAST(2, (avg(total_paid_tax_excl) - avg_total_paid) / avg_total_paid))))/3) > 1 THEN 5        when  ((LEAST(2, ((count(id_order) - avg_orders) / avg_orders))        + (IF(count(id_order) <= 1,        0,        LEAST(2, ((1 / (c_stats.full_year_or_subscription / count(c_stats.id_order)) - avg_between_orders_frequency) / (avg_between_orders_frequency)))        + LEAST(2, (avg(total_paid_tax_excl) - avg_total_paid) / avg_total_paid))))/3) BETWEEN 0.6 AND 1 THEN 4        when  ((LEAST(2, ((count(id_order) - avg_orders) / avg_orders))        + (IF(count(id_order) <= 1,        0,        LEAST(2, ((1 / (c_stats.full_year_or_subscription / count(c_stats.id_order)) - avg_between_orders_frequency) / (avg_between_orders_frequency)))        + LEAST(2, (avg(total_paid_tax_excl) - avg_total_paid) / avg_total_paid))))/3) BETWEEN 0.2 AND 0.6 THEN 3        when  ((LEAST(2, ((count(id_order) - avg_orders) / avg_orders))        + (IF(count(id_order) <= 1,        0,        LEAST(2, ((1 / (c_stats.full_year_or_subscription / count(c_stats.id_order)) - avg_between_orders_frequency) / (avg_between_orders_frequency)))        + LEAST(2, (avg(total_paid_tax_excl) - avg_total_paid) / avg_total_paid))))/3) BETWEEN 0 AND 0.2 THEN 2        when  ((LEAST(2, ((count(id_order) - avg_orders) / avg_orders))        + (IF(count(id_order) <= 1,        0,        LEAST(2, ((1 / (c_stats.full_year_or_subscription / count(c_stats.id_order)) - avg_between_orders_frequency) / (avg_between_orders_frequency)))        + LEAST(2, (avg(total_paid_tax_excl) - avg_total_paid) / avg_total_paid))))/3) BETWEEN -0.2 AND 0 THEN 1        ELSE 0    END as admin_customers_score_final

 

Share this post


Link to post
Share on other sites
Le 9/3/2019 à 1:55 PM, doekia a dit :

Celui qui génére l'erreur !! Probablement AdminCustomersController.php ou son override

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More