Too many duplicated queries by getNavigationBadge()
zenepay opened this issue · comments
It seems that each raw of table will call to this function getNavigationBadge(), then it created hundreds of multiple duplicated database queries.
Anyway, I had minor amend to
public static function getNavigationBadge(): ?string
{
if (!static::$count) {
static::$count = Utils::isResourceNavigationBadgeEnabled()
? static::getModel()::count()
: null;
}
return static::$count;
}
Hope this is the right way, otherwise please advise.