[+] BO : Back-office search use now AdminController.php

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@9858 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
vAugagneur
2011-11-03 17:14:13 +00:00
parent 8c5d2bfaf8
commit c9f065173b
6 changed files with 427 additions and 306 deletions
+15
View File
@@ -416,6 +416,21 @@ class CustomerCore extends ObjectModel
)'.$shop->addSqlRestriction(Shop::SHARE_CUSTOMER);
return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql);
}
/**
* Search for customers by ip address
*
* @param string $ip Searched string
*/
public static function searchByIp($ip)
{
return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
SELECT DISTINCT c.*
FROM `'._DB_PREFIX_.'customer` c
LEFT JOIN `'._DB_PREFIX_.'guest` g ON g.id_customer = c.id_customer
LEFT JOIN `'._DB_PREFIX_.'connections` co ON g.id_guest = co.id_guest
WHERE co.`ip_address` = \''.ip2long(trim($ip)).'\'');
}
/**
* Return several useful statistics about customer