Jump to content

ERROR [PrestaShopDatabaseException]


Recommended Posts

hello everybody, can you help me to fix this problem ..

when i click on customer, i see this page . 

=========================================================

 

 

[PrestaShopDatabaseException]

Illegal mix of collations for operation 'UNION'
 

			SELECT rsp.id_sponsorship, rsp.date_end, IF(rsp.date_end=0 OR rsp.date_end > NOW(), 1, 0) AS active, r.id_customer AS id_sponsor, IF(o.id_customer, o.id_customer, rsp.id_customer) AS id_sponsored, rsp.channel, IF(o.id_customer, c.firstname, rsp.firstname) AS firstname, IF(o.id_customer, c.lastname, rsp.lastname) AS lastname, rsd.level_sponsorship, SUM(IF(r.id_reward_state IN (2,4,7,8), r.credits, 0)) AS total_rewards, SUM(IF(o.valid=1, 1, 0)) AS nb_orders, ROUND(SUM(IF(o.valid=1, o.total_paid / o.conversion_rate, 0)), 2) AS total_orders
			/* les filleuls ayant donné une récompense */
			FROM `ps_rewards` AS r
			JOIN `ps_customer` AS c2 ON (c2.id_customer=r.id_customer AND c2.id_shop IN (1) )
			JOIN `ps_rewards_sponsorship_detail` AS rsd USING (id_reward)
			JOIN `ps_rewards_sponsorship` AS rsp USING (id_sponsorship)
			LEFT JOIN `ps_orders` AS o ON (o.id_order=r.id_order AND o.id_shop IN (1) )
			LEFT JOIN `ps_customer` AS c ON (o.id_customer=c.id_customer) WHERE r.id_customer=2
			GROUP BY r.id_customer, id_sponsored
			UNION
			/* les filleuls n ayant pas donné de récompense directe */
			SELECT rs.id_sponsorship, rs.date_end, IF(rs.date_end=0 OR rs.date_end > NOW(), 1, 0) AS active, rs.id_sponsor, rs.id_customer AS id_sponsored, rs.channel, rs.firstname, rs.lastname, 1 AS level_sponsorship, 0, 0, 0
			FROM `ps_rewards_sponsorship` AS rs
			JOIN `ps_customer` AS c ON (c.id_customer=rs.id_customer AND c.id_shop IN (1) )
			WHERE 0 = (
				SELECT count(*)	FROM `ps_rewards_sponsorship_detail` AS rsd2
				JOIN `ps_rewards` AS r2 USING (id_reward)
				WHERE rsd2.level_sponsorship=1
				AND rsd2.id_sponsorship=rs.id_sponsorship/*
				AND r2.id_reward_state IN (2,4,7,8)*/
			) AND rs.id_sponsor=2
			ORDER BY id_sponsor, level_sponsorship, lastname, firstname
			

 

 

 

at line 791 in file classes/db/Db.php

786. if ($webservice_call && $errno) { 787. $dbg = debug_backtrace(); 788. WebserviceRequest::getInstance()->setError(500, '

 '.$this->getMsgError().'. From '.(isset($dbg[3]['class']) ? $dbg[3]['class'] : '').'->'.$dbg[3]['function'].'() Query was : '.$sql, 97); 789. } elseif (_PS_DEBUG_SQL_ && $errno && !defined('PS_INSTALLATION_IN_PROGRESS')) { 790. if ($sql) { 791. throw new PrestaShopDatabaseException($this->getMsgError().'<br /><br /><pre>'.$sql.'</pre>'); 792. } 793. 794. throw new PrestaShopDatabaseException($this->getMsgError()); 795. } 796. }


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

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

DbCore->executeS - [line 665 - modules/allinone_rewards/models/RewardsSponsorshipModel.php] - [1 Arguments]

RewardsSponsorshipModel::_getSponsorshipsList - [line 519 - modules/allinone_rewards/models/RewardsSponsorshipModel.php] - [2 Arguments]

RewardsSponsorshipModel::getAdminStatistics - [line 2046 - modules/allinone_rewards/plugins/RewardsSponsorshipPlugin.php] - [1 Arguments]

RewardsSponsorshipPlugin->hookDisplayAdminCustomers - [line 706 - modules/allinone_rewards/allinone_rewards.php] - [1 Arguments]

allinone_rewards->_genericHook - [line 696 - modules/allinone_rewards/allinone_rewards.php] - [2 Arguments]

allinone_rewards->__call - [line 591 - classes/Hook.php] - [2 Arguments]

HookCore::coreCallHook - [line 546 - classes/Hook.php] - [3 Arguments]

Link to comment
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...