Jump to content
покупайте без комиссии
Search In
  • More options...
Find results that contain...
Find results in...
  • Sign Up

Recommended Posts

Здравствуйте, прошу помощи в исправлении ошибки. В программировании я не очень.

У нас стоит модуль производителей, в нем есть две возможности:
выбрать всех производителей или выбрать из списка.
При выборе из списка, он не видит производителей и в журнале появляются такие ошибки:

 

2018-07-09 13:16:30 - PHP Notice:  Error: Column 'name' in where clause is ambiguous<br />Error No: 1052<br />SELECT c.manufacturer_id, md.name, c.sort_order FROM oc_manufacturer c LEFT JOIN oc_manufacturer_description md ON (c.manufacturer_id = md.manufacturer_id) WHERE md.language_id = '1' AND name LIKE 'APECS%' ORDER BY name ASC LIMIT 0,5 in /system/library/db/mysqli.php on line 41
2018-07-09 13:16:30 - PHP Notice:  Trying to get property of non-object in /system/storage/modification/admin/model/catalog/manufacturer.php on line 159
2018-07-09 13:16:30 - PHP Warning:  Invalid argument supplied for foreach() in /admin/controller/catalog/manufacturer.php on line 488

 

in /system/storage/modification/admin/model/catalog/manufacturer.php on line 159

        if (isset($data['start']) || isset($data['limit'])) {
            if ($data['start'] < 0) {
                $data['start'] = 0;
            }

            if ($data['limit'] < 1) {
                $data['limit'] = 20;
            }

            $sql .= " LIMIT " . (int)$data['start'] . "," . (int)$data['limit'];
        }

        $query = $this->db->query($sql);

        return $query->rows;
    }

in /admin/controller/catalog/manufacturer.php on line 488

        if (utf8_strlen($this->request->post['keyword']) > 0) {
            $this->load->model('catalog/url_alias');

            $url_alias_info = $this->model_catalog_url_alias->getUrlAlias($this->request->post['keyword']);

            if ($url_alias_info && isset($this->request->get['manufacturer_id']) && $url_alias_info['query'] != 'manufacturer_id=' . $this->request->get['manufacturer_id']) {
                $this->error['keyword'] = sprintf($this->language->get('error_keyword'));
            }

            if ($url_alias_info && !isset($this->request->get['manufacturer_id'])) {
                $this->error['keyword'] = sprintf($this->language->get('error_keyword'));
            }

            if ($this->error && !isset($this->error['warning'])) {
                $this->error['warning'] = $this->language->get('error_warning');
            }
        }

        return !$this->error;
    }

Screenshot_2018-07-09 Стена производителей.png

Link to post
Share on other sites

21 минуту назад, helen2014 сказал:

WHERE md.language_id = '1' AND name LIKE 'APECS%'

 

AND md.name

 

21 минуту назад, helen2014 сказал:

ORDER BY name

ORDER BY md.name

Edited by thentru
Link to post
Share on other sites

17 минут назад, helen2014 сказал:

Поподробней можно?

исправить запросы как я написал в модификаторе, который вносит изменения в выборку производителей

Link to post
Share on other sites

На чистом ocStore 2.1.0.2.1

Все равно такая же ошибка. Модификатор не причем.

Может кто протестировать у себя работает ли  выборка производителей?

 

2018-07-16 1:28:37 - PHP Notice:  Error: Column 'name' in where clause is ambiguous<br />Error No: 1052<br />SELECT c.manufacturer_id, md.name, c.sort_order FROM oc_manufacturer c LEFT JOIN oc_manufacturer_description md ON (c.manufacturer_id = md.manufacturer_id) WHERE md.language_id = '1' AND name LIKE 'т%' ORDER BY name ASC LIMIT 0,5 in /home/c/ct55241/t_demo/public_html/system/library/db/mysqli.php on line 41
2018-07-16 1:28:37 - PHP Notice:  Trying to get property of non-object in /home/c/ct55241/t_demo/public_html/admin/model/catalog/manufacturer.php on line 159
2018-07-16 1:28:37 - PHP Warning:  Invalid argument supplied for foreach() in /home/c/ct55241/t_demo/public_html/admin/controller/catalog/manufacturer.php on line 488
2018-07-16 1:28:40 - PHP Notice:  Error: Column 'name' in where clause is ambiguous<br />Error No: 1052<br />SELECT c.manufacturer_id, md.name, c.sort_order FROM oc_manufacturer c LEFT JOIN oc_manufacturer_description md ON (c.manufacturer_id = md.manufacturer_id) WHERE md.language_id = '1' AND name LIKE 'те%' ORDER BY name ASC LIMIT 0,5 in /home/c/ct55241/t_demo/public_html/system/library/db/mysqli.php on line 41
2018-07-16 1:28:40 - PHP Notice:  Trying to get property of non-object in /home/c/ct55241/t_demo/public_html/admin/model/catalog/manufacturer.php on line 159
2018-07-16 1:28:40 - PHP Warning:  Invalid argument supplied for foreach() in /home/c/ct55241/t_demo/public_html/admin/controller/catalog/manufacturer.php on line 488

Link to post
Share on other sites

Не кто не знает?

Чистый ocStore 2.1.0.2.1

Ошибки те же.

2018-07-18 14:02:50 - PHP Notice:  Error: Column 'name' in where clause is ambiguous<br />Error No: 1052<br />SELECT c.manufacturer_id, md.name, c.sort_order FROM oc_manufacturer c LEFT JOIN oc_manufacturer_description md ON (c.manufacturer_id = md.manufacturer_id) WHERE md.language_id = '1' AND name LIKE 'т%' ORDER BY name ASC LIMIT 0,5 in /home/c/ct55241/t_demo/public_html/system/library/db/mysqli.php on line 41
2018-07-18 14:02:50 - PHP Notice:  Trying to get property of non-object in /home/c/ct55241/t_demo/public_html/admin/model/catalog/manufacturer.php on line 159
2018-07-18 14:02:50 - PHP Warning:  Invalid argument supplied for foreach() in /home/c/ct55241/t_demo/public_html/admin/controller/catalog/manufacturer.php on line 488

Link to post
Share on other sites

AND name LIKE

 

должно быть AND md.name LIKE

 

и order тоже с md

Edited by spectre
Link to post
Share on other sites
6 минут назад, spectre сказал:

AND name LIKE

 

должно быть AND md.name LIKE

 

и order тоже с md

Как это исправить?

Дело в движке.

 

Link to post
Share on other sites

2 минуты назад, helen2014 сказал:

Как это исправить?

Дело в движке.

 

 

Ну вот же ж я вам написал как исправить, если не можете сделать это самостоятельно - лс

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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

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.