indexs.php 705 B

12345678910111213141516171819202122232425
  1. <?php
  2. namespace Controller;
  3. class index extends \Qii\Base\Controller
  4. {
  5. public $enableDB = true;
  6. public function indexAction()
  7. {
  8. $data = array();
  9. $data['lists'][] = $this->db->getRow('SELECT * FROM ipAddress ORDER BY id DESC LIMIT 1');
  10. $data['lists'][] = $this->db->getRow('SELECT * FROM ipAddress ORDER BY id ASC LIMIT 1');
  11. $data['querySeconds'] = $this->db->querySeconds;
  12. return new \Qii\Base\Response(array('format' => 'json', 'body' => $data));
  13. }
  14. public function dispatchAction()
  15. {
  16. $this->dispatch('test', 'index');
  17. }
  18. public function forwardAction()
  19. {
  20. $this->setForward('test', 'index');
  21. }
  22. }