Files
Pichome/core/function/cache/cache_fields_required.php
2022-05-02 22:31:35 +08:00

34 lines
818 B
PHP

<?php
/*
* @copyright QiaoQiaoShiDai Internet Technology(Shanghai)Co.,Ltd
* @license https://www.oaooa.com/licenses/
*
* @link https://www.oaooa.com
* @author zyx(zyx@oaooa.com)
*/
if(!defined('IN_OAOOA')) {
exit('Access Denied');
}
function build_cache_fields_required() {
$data = array();
foreach(C::t('user_profile_setting')->fetch_all_by_available_required(1, 1) as $field) {
$choices = array();
if($field['selective']) {
foreach(explode("\n", $field['choices']) as $item) {
list($index, $choice) = explode('=', $item);
$choices[trim($index)] = trim($choice);
}
$field['choices'] = $choices;
} else {
unset($field['choices']);
}
$data['field_'.$field['fieldid']] = $field;
}
savecache('fields_required', $data);
}
?>