1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- <?php
- namespace addons\qingdongams\validate;
- use think\Validate;
- class Parts extends Validate
- {
- /**
- * 验证规则
- */
- protected $rule = [
- 'create_staff_id' => 'number',
- 'name' => 'require|max:50',
- 'num' => 'max:50',
- 'unit' => 'max:50',
- 'img' => 'max:32',
- 'banners' => 'max:64',
- 'stock' => 'number',
- 'price' => 'max:50',
- 'tax_price' => 'max:250',
- 'status' => 'number|between:0,1',
- 'description' => 'max:1000',
- ];
- /**
- * 提示消息
- */
- protected $message = [];
- /**
- * 字段描述
- */
- protected $field = [
- 'create_staff_id' => '创建人',
- 'name' => '零件名称',
- 'num' => '零件编码',
- 'unit' => '零件单位',
- 'img' => '零件图片',
- 'banners' => '零件轮播图',
- 'stock' => '库存',
- 'price' => '零件价格',
- 'status' => '是否上架',
- 'description' => '零件介绍',
- ];
- /**
- * 验证场景
- */
- protected $scene = [
- 'create' => [
- 'create_staff_id',
- 'name',
- 'num',
- 'unit',
- 'img',
- 'banners',
- 'stock',
- 'price',
- 'status',
- 'description',
- ],
- 'edit' => [],
- ];
- }
|