fix bug in "getUserFromTable"

add "getUserFromTableByEmail" function
This commit is contained in:
Sebastien Hattry 2021-05-26 10:19:31 +02:00
parent 9e338c4b7a
commit eab9460883

View file

@ -251,6 +251,34 @@ class WPCrm extends ApiV1
}
}
/**
* Get a customer from table
*
* @param int $crm_id The customer crm id
*
* @return object|null
*/
public static function getUserFromTable($crm_id)
{
return self::_getWpDB()->get_row(
'SELECT * FROM `ldc_wp_customers` WHERE `crm_id` = ' . $crm_id
);
}
/**
* Get a customer from table by an email
*
* @param int $email The customer email
*
* @return object|null
*/
public static function getUserFromTableByEmail($email)
{
return self::_getWpDB()->get_row(
'SELECT * FROM `ldc_wp_customers` WHERE `email` = "' . $email . '"'
);
}
/**
* Get a customer from table
*