public function index(){
$author = M('bookauthor');
$books = $author->where("a_view = 1")->select();
if(!empty($books)){
foreach($books as $key => $val) {
$bname = M('bookname')->where("b_view =1 AND aid =".$val['a_id'])->select();
if (!empty($bname)) {
$books[$key]['voo'] = $bname;
}
}
}
$this->assign('books',$books);
$this->display();
}
最佳答案