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('分类删除成功'); }