select 特定专栏 Zend Framework

select specific column Zend Framework

我想将下面的控制器更改为可以 select 从两列 (id , number)

public function invalidcustomersAction()
    {
        $smsModel = new Model_SimInCust(); 
        $select = $smsModel->select();
        $paginator = new Zend_Paginator(new Zend_Paginator_Adapter_DbTableSelect($select));
        $paginator ->setItemCountPerPage(5)
        ->setCurrentPageNumber($this->_getParam('page',1));
        $this->view->paginator = $paginator;
    }   

我的模型中已经有了这个

<?php
class Model_SimInCust extends Zend_Db_Table_Abstract
{
    protected $_name = 'invalid';
    protected $_schema  = 'invalid_sim';

}

将您的 select 编辑为:

$select = $smsModel->select()->from($smsModel, array('id','number'));