Hello
I have installed a prestashop 1.7.7.1
In backoffice when i go to index.php/sell/customers/ this error appears.
An exception occurred while executing 'SELECT c.id_customer, c.firstname, c.lastname, c.email, c.active, c.newsletter, c.optin, c.date_add, gl.name as social_title, s.name as shop_name, c.company, (SELECT SUM(total_paid_real / conversion_rate) FROM ps_orders o WHERE (o.id_customer = c.id_customer) AND (o.id_shop IN (?, ?, ?, ?, ?)) AND (o.valid = 1)) as total_spent, (SELECT con.date_add FROM ps_guest g LEFT JOIN ps_connections con ON con.id_guest = g.id_guest WHERE g.id_customer = c.id_customer ORDER BY con.date_add DESC LIMIT 1) as connect, IF(wcm.`phone` IS NULL,0,wcm.`phone`) AS `phone` FROM ps_customer c LEFT JOIN ps_gender_lang gl ON c.id_gender = gl.id_gender AND gl.id_lang = ? LEFT JOIN ps_shop s ON c.id_shop = s.id_shop LEFT JOIN `ps_customer` wcm ON wcm.`id_customer` = c.`id_customer` WHERE (c.deleted = 0) AND (c.id_shop IN (?, ?, ?, ?, ?)) AND (`lastname` LIKE ?) AND (wcm.`phone` = ?) ORDER BY c.date_add DESC LIMIT 50' with params [9, 1, 7, 10, 8, 1, 9, 1, 7, 10, 8, "%abcd%", "999999999"]:
SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'lastname' in where clause is ambiguous
I tried to discover the location of this sql statement but i cannot find it.
The error is that no table was added to sql and more than one table used in the statement has a column called lastname.
My problem is where to find this sql statement to correct it.
Thanks