antonioribeiro / antonioribeiro/tracker
logByRouteName counts all route hits, even if parameter was given
- Dominant language
- PHP
- Stars
- 2.9k
- Forks
- 594
- PR merge metrics
- No merged PRs in 30d
Description
I have route 'shop.index'. I'm using this code:
$weekAgo = Tracker::logByRouteName('shop.index', $rangeWeek)
->where(function($query)
{
$query
->where('parameter', 'shop')
->where('value', 'xxxx');
})
->count();
to get every shop hits. The problem is strange, let me explain this:
If I clear 'tracker_routes', 'tracker_route_paths' and 'tracker_route_paths_parameters' tables, and I will go to SomeShop shop (value of the route), every next hits will be counted to this shop (no matter of value - shop name). I hope that I'm enough understandable, this is a serious problem for me.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at Tracker::logByRouteName and inspect how it queries tracker_routes, tracker_route_paths, and tracker_route_paths_parameters. Reproduce the reported case after clearing those tables, then verify that hits with different route parameter values are not counted for the selected shop.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- laravel, php
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100