$a=array(1,2,3); for($i=0;$i<count($a);$i++){ $m[]=M('aaa')->where(array('pid'=>$a[$i],'status'=>'1','ground_id'=>2))->getField('title',true); }