我在 cakephp 中有问题
控制器
$due = $this->Issue->find('all' , array('conditions' => array ('Issue.user_id'=>6)));
$this->set('due',$due);
$id = $due['0']['Issue']['book_id'];
$b = $this->Bookmaster->find('first' , array ('conditions' => array ('Bookmaster.id' => $bookid)));
$book = $this->Book->find('all',array('conditions' => array ('Book.id' =>$id)));
$bookid = $book['0']['Book']['bookmaster_id'];
Ctp 包含
<h1> ISSUED BOOK DETAILS </h1>
<table width="200" border="2" bordercolor="#009933">
<tr>
<td> BOOK ID </td>
<td> TITLE </td>
<td> AUTHOR </td>
<td> EDITION </td>
<td>ISSUED ON </td>
<td> DUE DATE </td>
<td> POTENTIAL FINE</td>
</tr>
<?php foreach ($due as $data ) { ?> <tr>
<td> <?php echo $data['Issue']['book_id']; ?> </td>
<td> <?php echo $b ['Bookmaster']['title'] ;?></td>
<td> <?php echo $b['Bookmaster']['author'];?></td>
<td> <?php echo $b ['Bookmaster']['edition'];?> </td>
<td> <?php echo $data['Issue']['issue_date_time']; ?> </td>
<td> <?php echo $data['Issue']['due_date']; ?> </td>
<td> <?php echo $out['Fine']['fineamount'];?> </td>
</tr> <?php }?>
</table>
我的问题是如何使用 for 循环进行操作。我的循环没有为 bookmaster 迭代..所以我该怎么做..
如何增加 bookid 的值