Jump to content
Sign in to follow this  
bruklin

Ошибка при выводе статистики по покупателям

Recommended Posts

Добрый день.

 

Пытаюсь сформировать отчет по покупателям и сайт выдает ошибку:

 

Notice: Error: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay
Error No: 1104
SELECT t.customer_id, t.customer, t.email, t.customer_group, t.status, COUNT(t.order_id) AS orders, SUM(t.products) AS products, SUM(t.total) AS total FROM (SELECT c.customer_id, CONCAT(c.firstname, ' ', c.lastname) AS customer, c.email, cgd.name AS customer_group, c.status, o.order_id, SUM(op.quantity) as products, SUM(DISTINCT o.total) AS total FROM `oc_order` o LEFT JOIN `oc_order_product` op ON (o.order_id = op.order_id)LEFT JOIN `oc_customer` c ON (o.customer_id = c.customer_id) LEFT JOIN `oc_customer_group_description` cgd ON (c.customer_group_id = cgd.customer_group_id) WHERE o.customer_id > 0 AND cgd.language_id = '2' AND o.order_status_id > '0' GROUP BY o.order_id LIMIT 0,30) AS t GROUP BY t.customer_id ORDER BY total DESC in /home/p/plushno2ru/public_html/system/library/db/mysqli.php on line 41Notice: Trying to get property of non-object in /home/p/plushno2ru/public_html/admin/model/report/customer.php on line 131Warning: Invalid argument supplied for foreach() in /home/p/plushno2ru/public_html/admin/controller/report/customer_order.php on line 78

 

Понимаю, что где-то надо вставитьSET SQL_BIG_SELECTS=1, но не понимаю где.

 

Движок OC2.1

 

Заранее благодарен

Share this post


Link to post
Share on other sites

Методом "научного тыка" решено:

 

необходимо в файле system/library/db/mysqli.php между строками

$this->link->set_charset("utf8");
$this->link->query("SET SQL_MODE = ''");

вставить

$this->link->query("SET SQL_BIG_SELECTS=1");

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
You are posting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.