protected function getConfig() { $db = new ConfigModel(); $configList = $db->findAll(); $config = $this->toSingle($configList); $this->c = $config; $this->assign('c', $config); }
protected function getConfig($condition) { $db = new ConfigModel(); if ($condition == '') { $configList = $db->where("r=1")->select(); } elseif ($condition == 'all') { $configList = $db->findAll(); } else { $configList = $db->where("k='{$condition}'")->select(); } foreach ($configList as $item) { $config[$item['k']] = $item['v']; } return $config; }
protected function getConfig() { $db = new ConfigModel(); $configList = $db->findAll(); //dump($configList);exit; $config = $this->toSingle($configList); $this->assign('c', $config); return $config; }