12345678910111213141516171819202122232425262728293031323334353637 |
- <?php
- namespace app\admin\validate\medical;
- use think\Validate;
- class MedicalCareProductAttrValidate extends Validate
- {
- protected $rule = [
- 'attr_product_id' => 'require',
- 'attr_name' => 'require',
- 'attr_values' => 'require',
- 'attr_type' => 'require',
- 'attr_id' => 'require',
- ];
- protected $message = [
- 'attr_id.require' => 'ID不能为空',
- 'attr_product_id.require' => '所属产品能为空',
- 'attr_name.require' => '属性名称不能为空',
- 'attr_values.require' => '属性值不能为空',
- 'attr_type.require' => '产品类型不能为空',
- ];
- //场景
- protected $scene = [
- 'add' => [
- 'attr_product_id','attr_name','attr_values',
- 'attr_type'
- ],
- 'update' => [
- 'attr_product_id','attr_name','attr_values',
- 'attr_type'
- ],
- 'info' => ['product_id'],
- 'del' => ['product_id']
- ];
- }
|