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

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM