<?php
/*
* 项目: iOrange(橘子)
* 作者: 离家出走(yzxh24)
* Email: yzxh24@gmail.com
* 主页: www.iorange.cc
*/
/* vim: set ts=4 sw=4: */
class IndexAction extends SoftAction
{
    public function run()
    {
        $iorange = $this->iorange();

        $sql = 'SELECT id,name,pid FROM '.SoftContents::table().' WHERE isdelete = 0 ORDER BY id DESC LIMIT 10';
        $newList = $this->db()->setQueryString($sql)->find();

        $sql = 'SELECT id,name,pid FROM '.SoftContents::table().' WHERE isdelete = 0 AND iscommend = 1 LIMIT 10';
        $commends = $this->db()->setQueryString($sql)->find();
        
        $this->getController()->render('index', array(
                'iorange' => $iorange,
                'newList' => $newList,
                'commendList' => $commends,
            )
        );
    }
}