简体   繁体   中英

Laravel Query - whereJsonContains() reverse

It's possible to write in Laravel query reverse for whereJsonContains() query, something like: whereJsonDoesntContains() ?

I have problem with data filtering in Model. This code works perfectly:

$query->whereHas('attributes', function($q) use ($attribute)
{
    $q->where('attribute_product.attribute_id', $attribute->id)
      ->whereJsonContains('attribute_product.values', $someValue);
});

Now I want to create another query that returns products whereHas attributes with ID and JSON array in values column doesn't contain my variable.

Do you have any idea to do this?

是的,有一个像这样的函数: whereJsonDoesntContain

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM