[comment]: # ({8b346cf3-f9e8f670})
# 批量删除

[comment]: # ({/8b346cf3-f9e8f670})

[comment]: # ({d7f16b22-b5ff62ed})
### 描述

`object templategroup.massremove(object parameters)`

此方法允许从多个模板组删除相关对象.

::: noteclassic
此方法只有admin(管理员)和Super admin(超级管理员)用户可用.
可以在用户角色设置中撤销调用该方法的权限.更多信息请查看 [用户角色](/manual/web_interface/frontend_sections/users/user_roles).
:::

[comment]: # ({/d7f16b22-b5ff62ed})

[comment]: # ({a3a9bd8d-6102edd8})
### 参数

`(object)` 包含要更新的模板组 ID 以及应被移除的对象的参数。

|参数|[类型](/manual/api/reference_commentary#data-types)|描述|
|--|--|------|
|groupids|ID/array|要更新的[模板组](/manual/api/reference/templategroup/object#template-group)的 ID。<br><br>[参数行为](/manual/api/reference_commentary#parameter-behavior):<br>- *必需*|
|templateids|ID/array|要从所有模板组中移除的[模板](/manual/api/reference/template/object#template)的 ID。<br><br>[参数行为](/manual/api/reference_commentary#parameter-behavior):<br>- *必需*|

[comment]: # ({/a3a9bd8d-6102edd8})

[comment]: # ({9cf84bdf-2acda80b})
### 返回值

`(object)` 返回一个对象，该对象包含`groupids`属性下已更新的模板组的ID.

[comment]: # ({/9cf84bdf-2acda80b})

[comment]: # ({b41637d2-6044f589})
### 示例

[comment]: # ({/b41637d2-6044f589})

[comment]: # ({1a32b2fe-2f48a174})
#### 从模板组中删除模板

从给出的模板组中删除两个模板.

[请求](/manual/api#performing-requests):

```json
{
    "jsonrpc": "2.0",
    "method": "templategroup.massremove",
    "params": {
        "groupids": [
            "5",
            "6"
        ],
        "templateids": [
            "30050",
            "30001"
        ]
    },
    "id": 1
}
```

响应:

```json
{
    "jsonrpc": "2.0",
    "result": {
        "groupids": [
            "5",
            "6"
        ]
    },
    "id": 1
}
```

[comment]: # ({/1a32b2fe-2f48a174})

[comment]: # ({cb632db0-1d275edf})
### 来源
CTemplateGroup::massRemove() in *ui/include/classes/api/services/CTemplateGroup.php*.

[comment]: # ({/cb632db0-1d275edf})
