示例#1
0
        }
        break;
    case 'delete':
        if ($id) {
            $result = ItemType::deleteItem($id);
            $code = $result['code'];
            $msg = $result['msg'];
            $data = $result['data'];
        } else {
            $code = 1;
            $msg = "无效的id";
        }
        break;
    case 'get':
        $result = ItemType::getItemByID($id);
        $code = $result['code'];
        $msg = $result['msg'];
        $data = $result['data'][0];
        break;
    case 'list':
        break;
    case 'reload':
        $count = ItemType::count();
        $list = ItemType::getAllItem();
        Template::assign(array('p' => $p, 'total' => $count, 'items' => $list['data']));
        $data = Template::Render('op/typegrid.tpl');
        break;
    default:
        $code = 1;
        $msg = '没有这个操作';
}