fix logic error.
This commit is contained in:
parent
0010e4a6b7
commit
3a1ca54939
|
@ -236,6 +236,7 @@ class DataController extends Zend_Controller_Action
|
||||||
function seriesAction()
|
function seriesAction()
|
||||||
{
|
{
|
||||||
$id = $this->_request->getParam('id');
|
$id = $this->_request->getParam('id');
|
||||||
|
if (empty($id)) $id=0;
|
||||||
if (!is_numeric($id))
|
if (!is_numeric($id))
|
||||||
{
|
{
|
||||||
$name=$id;
|
$name=$id;
|
||||||
|
@ -244,15 +245,20 @@ class DataController extends Zend_Controller_Action
|
||||||
$md=new SeriesTable();
|
$md=new SeriesTable();
|
||||||
$db=$md->getAdapter();
|
$db=$md->getAdapter();
|
||||||
if (empty($id)) {
|
if (empty($id)) {
|
||||||
if (empty($name)) $this->_redirect('/data');
|
if (!empty($name))
|
||||||
|
{
|
||||||
$where=$db->quoteInto('name = ?',$name);
|
$where=$db->quoteInto('name = ?',$name);
|
||||||
$row=$md->fetchRow($where);
|
$row=$md->fetchRow($where);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$where=$db->quoteInto('id = ?',$id);
|
$where=$db->quoteInto('id = ?',$id);
|
||||||
$row=$md->fetchRow($where);
|
$row=$md->fetchRow($where);
|
||||||
}
|
}
|
||||||
|
if (!empty($id) or !empty($name))
|
||||||
|
{
|
||||||
if (!$row) $this->_redirect('/data');
|
if (!$row) $this->_redirect('/data');
|
||||||
$id=$row->id;
|
$id=$row->id;
|
||||||
|
}
|
||||||
$page=(int)$this->_request->getParam('page');
|
$page=(int)$this->_request->getParam('page');
|
||||||
if (empty($page)) $page=1;
|
if (empty($page)) $page=1;
|
||||||
$limit=10;
|
$limit=10;
|
||||||
|
|
|
@ -33,6 +33,6 @@ $this->breadcrumb()->setSeparator(' > ');
|
||||||
</h2>
|
</h2>
|
||||||
<span><?php echo mb_strlen($md['description'])>400?$this->escape(mb_substr($md['description'],0,400,'UTF-8').'...'):$this->escape($md['description']);?></span>
|
<span><?php echo mb_strlen($md['description'])>400?$this->escape(mb_substr($md['description'],0,400,'UTF-8').'...'):$this->escape($md['description']);?></span>
|
||||||
</div>
|
</div>
|
||||||
<?php endforeach; endif; ?>
|
<?php endforeach; ?>
|
||||||
</div>
|
</div>
|
||||||
<?php echo $this->page->getNavigation(); ?>
|
<?php echo $this->page->getNavigation(); endif; ?>
|
Loading…
Reference in New Issue