示例#1
0
 /**
  * 列表
  *
  */
 public function indexAction()
 {
     // 分页
     $page = intval($this->getg('page', 1));
     $pageSize = 10;
     // 排序
     $orderby = $this->getg('sort');
     if ($orderby) {
         $orderby = str_replace('.', ' ', $orderby);
     } else {
         $orderby = 'id asc';
     }
     // 实例化Model
     $log = new LogModel();
     // 查询条件
     $params = array('field' => array(), 'where' => array('status>' => 0), 'order' => $orderby, 'page' => $page, 'per' => $pageSize);
     // 列表
     $result = $log->getLists($params);
     // 数据总条数
     $total = $log->getCount($params);
     // 分页url
     $url = Tools_help::url('backend/log/index') . '?page=';
     $pagestr = Tools_help::pager($page, $total, $pageSize, $url);
     // 模版分配数据
     $this->_view->assign('pagestr', $pagestr);
     $this->_view->assign('result', $result);
     $this->_view->assign("pageTitle", '列表');
 }