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

        $field = 1 == $score ? 'good' : 'bad';
        $this->db()->update(SoftContents::table())->incrField(array($field=>1))->where(array('id'=>$id))->q();

        iforward(url('system', array('s'=>'soft','a'=>'view','id'=>$id)));
    }
}
