thinkphp5查询表达式IN使用小计
根据多个id批量更新指定字段值
$map[] = ['id','in', input('post.id/a')];
$result = db('picture')->where($map)->update(['posid' => 1]);
相当于sql语句:
UPDATE `yj_picture` SET `posid` = 1 WHERE `id` IN (1,2,3)
使用表达式like进行模糊查询
$map[] = array('title','like','%'.$keywords.'%');
db('picture')->where($map)->find();
持续更新.......懒得整理......
//查询字符串字段是否包含指定的参数
$list = Db::name('work')
->where('type', $type)
->where('find_in_set(:id,gradelist)', ['id' => $mid])
->select();