회원 전화번호 필드 인식 추가.

This commit is contained in:
BJRambo 2016-11-16 17:49:53 +09:00
parent c8dae083e6
commit 101356a50a
5 changed files with 74 additions and 0 deletions

View file

@ -141,6 +141,23 @@ class ncenterlite extends ModuleObject
return true;
}
$config = getModel('ncenterlite')->getConfig();
$member_config = getModel('member')->getMemberConfig();
$variable_name = array();
foreach($member_config->signupForm as $value)
{
if($value->type == 'tel')
{
$variable_name[] = $value->name;
}
}
if(!$config->variable_name && count($variable_name) == 1)
{
return true;
}
return false;
}
@ -226,6 +243,38 @@ class ncenterlite extends ModuleObject
$oDB->dropIndex('ncenterlite_notify', 'idx_notify');
}
$config = getModel('ncenterlite')->getConfig();
if(!$config)
{
$config = new stdClass();
}
if(!$config->variable_name)
{
$member_config = getModel('member')->getMemberConfig();
$variable_name = array();
foreach($member_config->signupForm as $value)
{
if($value->type === 'tel')
{
$variable_name[] = $value->name;
}
}
if(count($variable_name) === 1)
{
foreach($variable_name as $item)
{
$config->variable_name = $item;
}
$output = $oModuleController->insertModuleConfig('ncenterlite', $config);
if(!$output->toBool())
{
return new Object(-1, 'fail_module_install');
}
}
}
return new Object(0, 'success_updated');
}