正在显示
1 个修改的文件
包含
12 行增加
和
12 行删除
| @@ -40,16 +40,16 @@ class ProductRequest extends FormRequest | @@ -40,16 +40,16 @@ class ProductRequest extends FormRequest | ||
| 40 | 'route' => 'required|max:200', | 40 | 'route' => 'required|max:200', |
| 41 | 'gallery' => ['required', 'array'], | 41 | 'gallery' => ['required', 'array'], |
| 42 | 'icon' => 'required|array', | 42 | 'icon' => 'required|array', |
| 43 | - 'attrs' => ['array', function ($attribute, $value, $fail) { | ||
| 44 | - foreach ($value as $v) { | ||
| 45 | - if (empty($v['key'])) { | ||
| 46 | - $fail('产品属性名不能为空'); | ||
| 47 | - } | ||
| 48 | - if (empty($v['value'])) { | ||
| 49 | - $fail('产品属性值不能为空'); | ||
| 50 | - } | ||
| 51 | - } | ||
| 52 | - }], | 43 | +// 'attrs' => ['array', function ($attribute, $value, $fail) { |
| 44 | +// foreach ($value as $v) { | ||
| 45 | +// if (empty($v['key'])) { | ||
| 46 | +// $fail('产品属性名不能为空'); | ||
| 47 | +// } | ||
| 48 | +// if (empty($v['value'])) { | ||
| 49 | +// $fail('产品属性值不能为空'); | ||
| 50 | +// } | ||
| 51 | +// } | ||
| 52 | +// }], | ||
| 53 | 'category_id' => 'required', | 53 | 'category_id' => 'required', |
| 54 | 'intro' => 'required|max:500', | 54 | 'intro' => 'required|max:500', |
| 55 | 'content' => 'required', | 55 | 'content' => 'required', |
| @@ -72,8 +72,8 @@ class ProductRequest extends FormRequest | @@ -72,8 +72,8 @@ class ProductRequest extends FormRequest | ||
| 72 | 'route.max' => '产品链接不能超过200个字符', | 72 | 'route.max' => '产品链接不能超过200个字符', |
| 73 | 'gallery.required' => '请上传产品图片', | 73 | 'gallery.required' => '请上传产品图片', |
| 74 | 'gallery.array' => '产品图片格式异常', | 74 | 'gallery.array' => '产品图片格式异常', |
| 75 | - 'attrs.required' => '请添加产品参数', | ||
| 76 | - 'attrs.array' => '产品参数格式异常', | 75 | +// 'attrs.required' => '请添加产品参数', |
| 76 | +// 'attrs.array' => '产品参数格式异常', | ||
| 77 | 'icon.required' => '图标不能为空', | 77 | 'icon.required' => '图标不能为空', |
| 78 | 'category_id.required' => '请选择分类', | 78 | 'category_id.required' => '请选择分类', |
| 79 | 'intro.required' => '请输入短描述', | 79 | 'intro.required' => '请输入短描述', |
-
请 注册 或 登录 后发表评论