$list = $money_num -> where($name)->limit($Page->firstRow.','.$Page->listRows)->select();
foreach($list as $k => $name){
$zz_id = $name['zhuanzhang_id'];
$name_p = $tr -> where('userid='.$zz_id) -> getField('username');
$list[$k]['zz_name']=$name_p;
}
例子二:
public function index(){
$type = I('shop_type');
$msg = M('product');
$msg_shop = M('shopkucun');
$where['s_id']=6;
$arr = $msg_shop-> where($where)-> order("p_id") -> select();
foreach($arr as $v){
$where['p_id']=$v['p_id'];
$msg_detail[] = $msg -> where($where) -> find();
}
$this-> assign('msg_detail',$msg_detail);
$this->display('service');
}