Skip to content
关注公众号,获取新课通知

批量删除商品规格


控制器 app/controller/admin/Skus.php

php
public function deleteAll()
{
    $param = $this->request->param('ids');
    return showSuccess($this->M->where('id','in',$param)->delete());
}

验证器 app/validate/admin/Skus.php

php
// 验证规则
protected $rule = [
    ...
    'ids'=>'require|array'
    ...
];

protected $scene = [
    ...
    'deleteAll'=>['ids']
];

路由 router/admin.php

php
Route::post('skus/delete_all','admin.Skus/deleteAll');