function __construct() { parent::__construct(); $this->table = 'company'; $this->recognize($this->input->server('SERVER_NAME')); //获取存在数据库中的公司配置项 $this->db->from('company_config')->where('company', $this->id); $config = array_column($this->db->get()->result_array(), 'value', 'key'); array_walk($config, function (&$value) { $decoded = json_decode($value, true); if (!is_null($decoded)) { $value = $decoded; } }); $this->config->company = $config; }
function __construct($data = null, array $args = array()) { parent::__construct($data, $args); }