ThinkPHP3.2.3中,查询语句中in的使用方法。

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ThinkPHP3.2.3中,查询语句中in的使用方法。相关的知识,希望对你有一定的参考价值。

//删除分类
public function del(){
$cid = I(‘get.cid‘);
$cate = M(‘category‘)->field(‘cid,pid‘)->select();
$cate = $this->son_cate($cate,$cid);
$cate[] = $cid;//$cate为一个数组
$where[‘cid‘] = array(‘in‘,$cate);//cid在这个数组中,
M(‘category‘)->where($where)->delete();//$where作为条件传进来
$this->success(‘分类删除成功‘);
}

 

以上是关于ThinkPHP3.2.3中,查询语句中in的使用方法。的主要内容,如果未能解决你的问题,请参考以下文章