Commit 823afbf7 by 王召彬

根据配置名称查询所有匹配项

parent 17660a59
......@@ -145,6 +145,26 @@ class CfgCenter
return is_array($resArr) ? $resArr : $result['value'];
}
/**
* 根据配置名称查询所有匹配项。包含所有oem机构的配置
*
* @param string $keyName
* @return array
*/
public static function getByKey(string $keyName)
{
$result = [];
$dbConn = self::dbConnect();//连接配置库
$rows = $dbConn->select("config", ['oemId', 'value'], ['name' => $keyName]);
foreach($rows as $row) {
$result[$row['oemId']] = [
'oemId' => $row['oemId'],
'value' => json_decode($row['value'], true),
];
}
return $result;
}
public static function dbConnect($database='')
{
if($database == '') {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment