Index.php 598 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace app\index\controller;
  3. use app\common\controller\Frontend;
  4. class Index extends Frontend
  5. {
  6. protected $layout = 'bootstrap';
  7. public function _initialize()
  8. {
  9. parent::_initialize();
  10. }
  11. public function index()
  12. {
  13. return $this->view->fetch();
  14. }
  15. public function news()
  16. {
  17. $newslist = \app\common\model\Page::where('category_id', 1)->order('weigh', 'desc')->select();
  18. return jsonp(['newslist' => $newslist, 'new' => count($newslist), 'url' => 'http://www.fastadmin.net?ref=news']);
  19. }
  20. }