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

系统设置


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

php
public function set()
   {
   	$param = request()->param();
       $res = \app\model\SysSetting::update($param,['id' => 1]);
       return showSuccess($res);
   }

验证器 app/validate/SysSetting.php

php
protected $rule = [
	'open_reg'=>'in:0,1',
	'reg_method'=>'in:username,phone',
	'password_min'=>'integer|>:0',
	'upload_method'=>'in:local,oss',
	'api_safe'=>'in:0,1',
	'close_order_minute'=>'integer|>=:0',
	'auto_received_day'=>'integer|>=:0',
	'after_sale_day'=>'integer|>=:0',
];
 protected $scene = [
   	'set'=>['open_reg','reg_method','password_min','upload_method','api_safe','close_order_minute','auto_received_day','after_sale_day']
   ];

路由 router/admin.php

php
Route::post('sysconfig','admin.SysSetting/set');