application/manage/controller/Config.php
public function saveConfig(Request $request)
    {
        $config = $request->param('config/a', []);
        
        // 逐条保存
        $config_logic = ConfigLogic::instance();
        foreach ($config as $co => $vo) {
            $map = [
                'config_name' => $co
            ];
            $data = [
                'config_value' => is_array($vo) ? json_encode($vo, JSON_UNESCAPED_UNICODE) : $vo
            ];
            $config_logic->saveConfig($data, $map);
        }
        
        return $this->success('保存设置成功');
    }
public function saveConfig(Request $request)
    {
        $config = $request->param('config/a', []);
        
        // 逐条保存
        $config_logic = ConfigLogic::instance();
        foreach ($config as $co => $vo) {
            $map = [
                'config_name' => $co
            ];
            $data = [
                'config_value' => is_array($vo) ? json_encode($vo, JSON_UNESCAPED_UNICODE) : $vo
            ];
            $config_logic->saveConfig($data, $map);
        }
        
        return $this->success('保存设置成功');
    }
public function saveConfig ( Request $ request ) { $ config = $ request -> param ( 'config/a' , [ ] ) ; // 逐条保存 $ config_logic = ConfigLogic :: instance ( ) ; foreach ( $ config as $ co => $ vo ) { $ map = [ 'config_name' => $ co ] ; $ data = [ 'config_value' => is_array ( $ vo ) ? json_encode ( $ vo , JSON_UNESCAPED_UNICODE ) : $ vo ] ; $ config_logic -> saveConfig ( $ data , $ map ) ; } return $ this -> success ( '保存设置成功'); }
保存设置

@param Request $request
@return mixed
保存设置