<?php
/*
* 项目: iOrange(橘子)
* 作者: 离家出走(yzxh24)
* Email: yzxh24@gmail.com
* 主页: www.iorange.cc
*/
/* vim: set ts=4 sw=4: */
class PlatformAction extends SoftAction
{
    public function run()
    {
        $pid = S::gp('id', 'G', 2);
        $name = SoftPlatforms::getName($pid);

        $newList = SoftContent::model()->findAll(array('select'=>'id,name,cid,pid','condition'=>'pid='.$pid.' AND isdelete = 0','order'=>'id DESC','limit'=>10));
        $softList = SoftContent::model()->findAll(array('select'=>'id,name,cid,pid','condition'=>'pid='.$pid.' AND isdelete = 0 AND type = 1','order'=>'id DESC','limit'=>10));
        $gameList = SoftContent::model()->findAll(array('select'=>'id,name,cid,pid','condition'=>'pid='.$pid.' AND isdelete = 0 AND type = 2','order'=>'id DESC','limit'=>10));
        $commendList = SoftContent::model()->findAll(array('select'=>'id,name,cid,pid','condition'=>'pid='.$pid.' AND isdelete = 0 AND iscommend = 1','order'=>'id DESC','limit'=>10));

        $this->getController()->render('platform', array(
                'pid' => $pid,
                'name' => $name,
                'newList' => $newList,
                'softList' => $softList,
                'commendList' => $commendList,
                'gameList' => $gameList,
            )
        );
    }
}