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

        if (!$_GET['confirm'])
        {
            $message[] = '确定要删除吗？删除后将不可恢复！';
            $message[] = $this->getController()->link('删除',url('system',array('s'=>'bcart','c'=>'member','a'=>'delete','id'=>$bcart['id'],'confirm'=>1))).'|'.$this->getController()->link('取消',url('system',array('s'=>'bcart','c'=>'member')));
            $this->showMessage($message);
        }

        $this->db()->update(Bcarts::table())->value(array('isdelete'=>1))->where(array('id'=>$bcart['id']))->q();
        iforward(url('system', array('s'=>'bcart','c'=>'member')));
    }
}
