在json字段mysql中匹配数据

时间:2018-02-22 08:39:14

标签: php mysql json laravel

这是我的桌面截图: enter image description here

如果我有单个类别ID,如:3或11匹配这个完整的json。

我尝试了json_contains或json_search。

1 个答案:

答案 0 :(得分:0)

试试这个

Tax::where("json_contains('category_ids','like','%'.$id.'%')")->get(['id']);