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

删除商品规格


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

php
public function delete($id)
{
    $sku = $this->request->Model;
    return showSuccess($sku->delete());
}

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

php
// 验证规则
protected $rule = [
    ...
    'id'=>'require|integer|>:0|isExist:Skus',
    ...
];

protected $scene = [
    ...
    'delete'=>['id'],
];

路由 router/admin.php

php
Route::post('skus/:id/delete','admin.Skus/delete');