thinkphp5.0中where条件数据库字段保存为逗号隔开,查询的时候使用concat

做项目的时候,别人的源码数据二次开发

三级分类查询对方没有做(可能嫌麻烦→_→),

通过

$where = "concat (',',type_ids,',') like '%,".$type_id.",%'";

Db::table('table')->where($where)->select;

posted @ 2020-09-09 18:46  _lizhipeng  阅读(1228)  评论(0编辑  收藏  举报