更新配置搜索

This commit is contained in:
吴昊天 2023-03-20 14:37:44 +08:00
parent d4a9167edb
commit 3f3453b784

View File

@ -34,20 +34,23 @@ class SystemConfigDao extends BaseDao
* 获取某个系统配置
* @param string $configNmae
* @return mixed
* @throws \ReflectionException
*/
public function getConfigValue(string $configNmae)
{
return $this->withSearchSelect(['menu_name'], ['menu_name' => $configNmae])->value('value');
return $this->search(['menu_name' => $configNmae])->value('value');
}
/**
* 获取所有配置
* @param array $configName
* @return array
* @throws \ReflectionException
*/
public function getConfigAll(array $configName = [])
{
if ($configName) {
return $this->withSearchSelect(['menu_name'], ['menu_name' => $configName])->column('value', 'menu_name');
return $this->search(['menu_name' => $configName])->column('value', 'menu_name');
} else {
return $this->getModel()->column('value', 'menu_name');
}