<?php
/**
 * ajax修改版块的排序
 * @author yzxh24
 */
class EditOrderAction extends BaseAction
{
    public function run()
    {
        if (Yii::app()->request->isAjaxRequest)
        {
            $fid = intval(Yii::app()->request->getQuery('fid'));
            $view = intval(Yii::app()->request->getQuery('view'));
            $forum = Forum::model()->findByPk($fid);
            if (empty($forum))
            {
                echo '不存在的版块';
                Yii::app()->end();
            }
            $forum->vieworder = $view;
            $forum->save();
        }
    }
}