|
@@ -6,6 +6,7 @@ class DonateValidator extends BaseValidator
|
|
|
public static $rules = [
|
|
public static $rules = [
|
|
|
'id' => 'required',
|
|
'id' => 'required',
|
|
|
'title' => 'required|string|min:1|max:20',
|
|
'title' => 'required|string|min:1|max:20',
|
|
|
|
|
+ 'phone' => 'required|string|min:1|max:20',
|
|
|
'stock' => 'required|string|min:1|max:10',
|
|
'stock' => 'required|string|min:1|max:10',
|
|
|
'thumb' => 'required|string|min:2|max:250',
|
|
'thumb' => 'required|string|min:2|max:250',
|
|
|
'description' => 'required|string|min:2|max:500',
|
|
'description' => 'required|string|min:2|max:500',
|
|
@@ -24,6 +25,7 @@ class DonateValidator extends BaseValidator
|
|
|
// 当前模型所有验证字段
|
|
// 当前模型所有验证字段
|
|
|
public static $fields = [
|
|
public static $fields = [
|
|
|
'id' => 'ID',
|
|
'id' => 'ID',
|
|
|
|
|
+ 'phone' => '联系方式',
|
|
|
'stock' => '数量',
|
|
'stock' => '数量',
|
|
|
'thumb' => '图片',
|
|
'thumb' => '图片',
|
|
|
'title' => '物品名称',
|
|
'title' => '物品名称',
|
|
@@ -33,7 +35,7 @@ class DonateValidator extends BaseValidator
|
|
|
// 当前模型所有验证场景
|
|
// 当前模型所有验证场景
|
|
|
public static $scenes = [
|
|
public static $scenes = [
|
|
|
'info'=> ['id'],
|
|
'info'=> ['id'],
|
|
|
- 'send'=> ['title','stock','description','thumb'],
|
|
|
|
|
|
|
+ 'send'=> ['title','phone','stock','description','thumb'],
|
|
|
];
|
|
];
|
|
|
|
|
|
|
|
/**
|
|
/**
|