如何解决PHP 类中的返回错误Zend 框架
我在我的应用程序中使用 ZF1 并进行报告,我的应用程序返回错误:
Parse error: syntax error,unexpected 'return' (T_RETURN) in /var/www/html/application/models/DbTable/Pac.php on line 51
我搜索过,但没有发现语法错误。你发现我班上的‘return’有什么问题吗?
我是这样做的:
/application/models/DbTable/Pac.php
class Application_Model_DbTable_Pac extends Fits_Db_Table
{
protected $_name = 'pac';
protected $_validate_fields = array (
'name',);
public function getReport($month) {
$subselect = $this->select()
->from(['o'=>'orcamento'],['pac_id'])
->join(['op' => 'orcamento_procedimento'],'o.orcamento_id = op.orcamento_id','')
->where('op.orcamento_procedimento_status_id = 4')
->where('op.especialidade = 5')
->where('op.deleted = 0')
->where('op.data_execucao >= DATE_SUB(NOW,INTERVAL '.$month.' MONTH)');
$select = $this->select()
->from('pac')
->where('ort_status_id = 2')
->where('pac_id NOT IN '.$subselect)
->order('name ASC');
return $this->fetchResult($select); //Line 51 informed in the error
}
...
/application/modules/default/controllers/PacController.php
class Default_PacController extends Fits_Controller_Action
{
public function reportAction() {
$this->_breadcrumb = array(
array('Home','/',''),array('Pac','','active'),);
$this->_sessao = 1.4;
$dbPac = new Application_Model_DbTable_Pac();
$month = 1;
$report = $dbPac->getReport($month);
$this->view->pac = $report;
}
...
/application/modules/default/views/scripts/pac/relat.phtml
...
<tr>
<th style="width:50%">Name</th>
<th style="width:14%">Last time</th>
</tr>
</thead>
<tbody>
<?foreach($this->relat as $v){?>
<tr>
<td style="vertical-align: middle"><?=isset($this->dados['ort_pac_name'])?></td>
<td style="vertical-align: middle" class="text-center"><?=$v['name']?></td>
</td>
</tr>
<?}?>
...
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。