ThinkPHP3.2.3中,查询语句中in的使用方法。
时间:2016-10-07 23:08:14
收藏:0
阅读:1233
//删除分类 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(‘分类删除成功‘); }
原文:http://www.cnblogs.com/yxhblogs/p/5936921.html
评论(0)