Saturday, August 8, 2020

A better way to use the finder within a blob?

So I have a column in my table, that is a blob of usergroup ids... ex: ["2","3","5","9"]

I would like to search this table, for results in which the user's group's match this column.

Currently I am doing it was follows:

PHP:

$visitor = \XF::visitor();

$whereOr = [
[' Category.category_groups', 'LIKE', '%"'.$visitor->user_group_id.'"%'],
];

foreach ($visitor->secondary_group_ids AS $group)
{
$whereOr[] =......

A better way to use the finder within a blob?

source https://xfmaster.com/threads/a-better-way-to-use-the-finder-within-a-blob.15524/

No comments:

Post a Comment