Store three-letter country code instead of calling code

This commit is contained in:
Kijin Sung 2020-03-18 22:05:19 +09:00
parent 342c011a6c
commit 0e9ce525da
8 changed files with 87 additions and 38 deletions

View file

@ -304,7 +304,18 @@ class memberModel extends member
function getMemberInfoByPhoneNumber($phone_number, $phone_country = null)
{
if(!$phone_number) return;
if($phone_country)
{
if(preg_match('/^[A-Z]{3}$/', $phone_country))
{
$phone_country = array($phone_country, preg_replace('/[^0-9]/', '', Rhymix\Framework\i18n::getCallingCodeByCountryCode($phone_country)));
}
else
{
$phone_country = array(preg_replace('/[^0-9]/', '', $phone_country), Rhymix\Framework\i18n::getCountryCodeByCallingCode($phone_country));
}
}
$args = new stdClass();
$args->phone_number = $phone_number;
$args->phone_country = $phone_country;