fix bug in "getUserFromTable"
add "getUserFromTableByEmail" function
This commit is contained in:
parent
9e338c4b7a
commit
eab9460883
1 changed files with 28 additions and 0 deletions
|
|
@ -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
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue