chore(addon/aikefu): 调整config的配置内容
This commit is contained in:
@@ -20,6 +20,15 @@ class Config extends BaseModel
|
||||
public function setConfig($data, $site_id = 0, $app_module = 'shop')
|
||||
{
|
||||
$config = new ConfigModel();
|
||||
|
||||
// 获取原始配置
|
||||
$original_config = $this->getConfig($site_id, $app_module)['data']['value'] ?? [];
|
||||
|
||||
// 如果 API Key 为空或保持不变,则使用原始值
|
||||
if (isset($data['api_key']) && empty($data['api_key'])) {
|
||||
$data['api_key'] = $original_config['api_key'] ?? '';
|
||||
}
|
||||
|
||||
$res = $config->setConfig($data, '智能客服配置', 1, [['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'AIKEFU_CONFIG']]);
|
||||
return $res;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user