根据多个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();

持续更新.......懒得整理......

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-29
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-06-15
  • 2022-12-23
  • 2022-01-31
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案