Laravel-5.6-and-Vue.j-2-Dataviewer-Advanced-Filter icon indicating copy to clipboard operation
Laravel-5.6-and-Vue.j-2-Dataviewer-Advanced-Filter copied to clipboard

Small bug in code here on git

Open Dach0 opened this issue 5 years ago • 2 comments

In here

 public function apply($query, $data)
    {
        if(isset($data['f'])) {
            foreach($data['f'] as $filter) {
                $filter['match'] = isset($filter['filter_match']) ? $ $filter['filter_match'] : 'and';  //here is the thing
                $this->makeFilter($query, $filter);
            }
        }
        return $query;
    }

instead of

$filter['filter_match']

it should be

$data['filter_match']

And by the way, one more thank for sharing this. It is an amazing job, I've learned a lot using your video and this code.

Best regards

Dach0 avatar Nov 26 '19 14:11 Dach0

@Dach0 Well I don't think this repo is active but as to your query/ suggestion. with your suggestion the filter_match will be applied to all the queries. with authors method, we need to add individual filter_match like f[1][filter_match]=or and so for each query* in the in the prams. so gives more control.

princeteck avatar Jan 22 '23 09:01 princeteck

Mhm, probably it's not active anymore. It has been a long time since I used it, and I've made some changes and updates locally, kind of a fork, so can't give some updated/useful comments. But very useful content here.

Dach0 avatar Jan 23 '23 07:01 Dach0