melli20 Posted August 7, 2015 Share Posted August 7, 2015 Estoy realizando la siguiente consulta dentro del controlador AdminCustomerController.php y no me devuelve nada. $sql = 'SELECT * FROM `'._DB_PREFIX_.'customer` order by id_customer desc limit 1'; $result = Db::getInstance()->executeS($sql); ¿Que puede que este fallando? Link to comment Share on other sites More sharing options...
ventura Posted August 7, 2015 Share Posted August 7, 2015 En la medida de lo posible utiliza las funciones propias de Prestashop para las consultas /** * Return customers list * * @return array Customers */ public static function getCustomers() { $sql = 'SELECT `id_customer`, `email`, `firstname`, `lastname` FROM `'._DB_PREFIX_.'customer` WHERE 1 '.Shop::addSqlRestriction(Shop::SHARE_CUSTOMER).' ORDER BY `id_customer` ASC'; return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql); } Link to comment Share on other sites More sharing options...
melli20 Posted August 7, 2015 Author Share Posted August 7, 2015 En la medida de lo posible utiliza las funciones propias de Prestashop para las consultas /** * Return customers list * * @return array Customers */ public static function getCustomers() { $sql = 'SELECT `id_customer`, `email`, `firstname`, `lastname` FROM `'._DB_PREFIX_.'customer` WHERE 1 '.Shop::addSqlRestriction(Shop::SHARE_CUSTOMER).' ORDER BY `id_customer` ASC'; return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql); } Pero esta función no hace exactamente lo que yo necesito, ya que el orden me lo da al contrario Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now