【发布时间】:2018-10-22 08:30:59
【问题描述】:
可以在 Laravel 中为 whereJsonContains() 查询反向查询,例如:whereJsonDoesntContains()?
我在模型中的数据过滤有问题。此代码完美运行:
$query->whereHas('attributes', function($q) use ($attribute)
{
$q->where('attribute_product.attribute_id', $attribute->id)
->whereJsonContains('attribute_product.values', $someValue);
});
现在我想创建另一个查询,该查询返回具有 ID 和 JSON 数组的属性列中不包含我的变量的产品。
你有什么想法吗?
【问题讨论】:
标签: php laravel laravel-5 eloquent laravel-query-builder