<?php
/*
* 项目: iOrange(橘子)
* 作者: 离家出走(yzxh24)
* Email: yzxh24@gmail.com
* 主页: www.iorange.cc
*/
/* vim: set ts=4 sw=4: */
class IndexAction extends MemberAction
{
    public function run()
    {
        $result = Task::model()->getList($this->uid());
        $taskList = $result[0];
        $doIngList = $result[1];

        $totalCredit = 0;
        if (!empty($taskList))
        {
            foreach ($taskList as $task)
            {
                $totalCredit += $task->reward;
            }
        }
        $this->getController()->render('index', array(
                'taskList' => $taskList,
                'doIngList' => $doIngList,
                'totalCredit' => $totalCredit
            )
        );
    }
}