public function formatInputRecord($data)
    {
        $model = static::getQueryModel();
        
        if (!$data || !isset($model['primary_key']) || !isset($model['fields'])) {
            return $data;
        }
        
        $fdata = [];
        $fields_names = isset($model['master_fields']) ? $model['master_fields'] : array_keys($model['fields']);;
        foreach ($data as $k => $v){
            if (is_numeric($k)) {
                $fdata[$k] = $v;
            } elseif (in_array($k, $fields_names)) {
                $fdata[$k] = FieldInputHandler::formatValue($model['fields'][$k], $v);
            }
        }
        
        // check other autoset field
        if (in_array('update_time', $fields_names) && !isset($fdata['update_time'])) {
            $fdata['update_time'] = time();
        }
        return $fdata;
    }
public function formatInputRecord($data)
    {
        $model = static::getQueryModel();
        
        if (!$data || !isset($model['primary_key']) || !isset($model['fields'])) {
            return $data;
        }
        
        $fdata = [];
        $fields_names = isset($model['master_fields']) ? $model['master_fields'] : array_keys($model['fields']);;
        foreach ($data as $k => $v){
            if (is_numeric($k)) {
                $fdata[$k] = $v;
            } elseif (in_array($k, $fields_names)) {
                $fdata[$k] = FieldInputHandler::formatValue($model['fields'][$k], $v);
            }
        }
        
        // check other autoset field
        if (in_array('update_time', $fields_names) && !isset($fdata['update_time'])) {
            $fdata['update_time'] = time();
        }
        return $fdata;
    }
public function formatInputRecord ( $ data ) { $ model = static :: getQueryModel ( ) ; if ( ! $ data || ! isset ( $ model [ 'primary_key' ] ) || ! isset ( $ model [ 'fields' ] ) ) { return $ data ; } $ fdata = [ ] ; $ fields_names = isset ( $ model [ 'master_fields' ] ) ? $ model [ 'master_fields' ] : array_keys ( $ model [ 'fields' ] ) ; ; foreach ( $ data as $ k => $ v ) { if ( is_numeric ( $ k ) ) { $ fdata [ $ k ] = $ v ; } elseif ( in_array ( $ k , $ fields_names ) ) { $ fdata [ $ k ] = FieldInputHandler :: formatValue ( $ model [ 'fields' ] [ $ k ] , $ v ) ; } } // check other autoset field if ( in_array ( 'update_time' , $ fields_names ) && ! isset ( $ fdata [ 'update_time' ] ) ) { $ fdata [ 'update_time' ] = time ( ) ; } return $ fdata ; }
format one record input for insert or update, it will remove filed which not in master_fields

@param  array $data
@return array
format one record input for insert or update it will remove filed which not in master_fields