Commit 6f9143e6 by 王召彬

配置中心配置继承

parent abc1e732
...@@ -161,10 +161,18 @@ class CfgCenter ...@@ -161,10 +161,18 @@ class CfgCenter
private static function _getConfigFromDb($keyName, $oemId) private static function _getConfigFromDb($keyName, $oemId)
{ {
$dbConn = self::dbConnect(); $dbConn = self::dbConnect();
$result = $dbConn->select("config", ['name', 'value'], ['oemId' => $oemId, 'name' => $keyName]); $result = $dbConn->select("config", ['value'], ['oemId' => $oemId, 'name' => $keyName]);
if (!isset($result[0]['value'])) {
if($oemId > 0) {
// 如果指定的oemId查找不到,则使用活动啦啦(oemId==0)的配置
$result = $dbConn->select("config", ['value'], ['oemId' => 0, 'name' => $keyName]);
if (!isset($result[0]['value'])) { if (!isset($result[0]['value'])) {
return; return;
} }
} else {
return;
}
}
$valArr = json_decode($result[0]['value'], true); $valArr = json_decode($result[0]['value'], true);
if (!is_array($valArr)) { if (!is_array($valArr)) {
return $result[0]['value']; return $result[0]['value'];
......
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