On this page
添加运费模板
控制器 app/controller/admin/Express.php
php
public function save(Request $request)
{
$res = $this->M->save($request->param());
return showSuccess($res);
}
验证器 app/validate/admin/Express.php
php
// 验证规则
protected $rule = [
'name'=>'require',
'type'=>'require|in:0,1,2',
'order'=>'integer|>=:0',
];
protected $scene = [
// ...
'save'=>['name','type','order'],
];
路由 router/admin.php
Route::post('express','admin.Express/save');