TP框架 查詢條件(不同欄位相同查詢條件)
阿新 • • 發佈:2019-01-25
//我發展的代理(下級) public function next_agency(){ $agency_uid=1950; $search=I('get.search'); $p_num = 20; $p = $_REQUEST['p'] ? $_REQUEST['p'] : 1; $page_begin = ($p - 1)*$p_num; $where=[]; if(!empty($search)){ //不同欄位相同查詢條件 $where['agency_uid|nickname'] = $search; } $where['agency_pid']=$agency_uid; $list=M('agency_copy')->field('agency_uid,nickname,mobile,level')->order('agency_uid desc')->limit("$page_begin,$p_num")->where($where)->select(); print_r($list);die; }