application/manage/controller/Config.php
public function modifyConfig(Request $request)
    {
        $id = $request->param('id');
        if (empty($id)) {
            return $this->error('ID为空');
        }
    
        $field_arr = [
            'config_group',
            'config_sort'
        ];
        $field = $request->param('field');
        if (! in_array($field, $field_arr)) {
            return $this->error('非法的字段');
        }
    
        $value = $request->param('value', '');
        ConfigLogic::model()->modify($id, $field, $value);
    
        return $this->success('更改成功', Url::build('config/index'));
    }
public function modifyConfig(Request $request)
    {
        $id = $request->param('id');
        if (empty($id)) {
            return $this->error('ID为空');
        }
    
        $field_arr = [
            'config_group',
            'config_sort'
        ];
        $field = $request->param('field');
        if (! in_array($field, $field_arr)) {
            return $this->error('非法的字段');
        }
    
        $value = $request->param('value', '');
        ConfigLogic::model()->modify($id, $field, $value);
    
        return $this->success('更改成功', Url::build('config/index'));
    }
public function modifyConfig ( Request $ request ) { $ id = $ request -> param ( 'id' ) ; if ( empty ( $ id ) ) { return $ this -> error ( 'ID为空'); } $ field_arr = [ 'config_group' , 'config_sort' ] ; $ field = $ request -> param ( 'field' ) ; if ( ! in_array ( $ field , $ field_arr ) ) { return $ this -> error ( '非法的字段'); } $ value = $ request -> param ( 'value' , '' ) ; ConfigLogic :: model ( ) -> modify ( $ id , $ field , $ value ) ; return $ this -> success ( '更改成功', Url::b u ld( 'c onfig / index')); }
更改配置

@param Request $request
@return mixed
更改配置