On this page
批量删除商品类型
控制器 app/controller/admin/GoodsType.php
php
public function deleteAll()
{
$param = $this->request->param('ids');
return showSuccess($this->M->where('id','in',$param)->delete());
}
验证器 app/validate/admin/GoodsType.php
php
// 验证规则
protected $rule = [
...
'ids'=>'require|array'
...
];
protected $scene = [
...
'deleteAll'=>['ids']
];
路由 router/admin.php
php
Route::post('goods_type/delete_all','admin.GoodsType/deleteAll');