123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <?php
- namespace addons\qingdongams\validate;
- use think\Validate;
- class Product extends Validate {
- /**
- * 验证规则
- */
- protected $rule = [
- 'create_staff_id' => 'number',
- 'name' => 'require|max:50',
- 'num' => 'max:50',
- 'unit' => 'max:50',
- 'product_line' => 'max:50',
- 'bar_code' => 'max:50',
- 'price' => 'max:50',
- 'tax_price' => 'max:250',
- 'status' => 'number|between:0,1',
- ];
- /**
- * 提示消息
- */
- protected $message = [];
- /**
- * 字段描述
- */
- protected $field = [
- 'create_staff_id' => '创建人',
- 'name' => '产品名称',
- 'num' => '产品编码',
- 'unit' => '产品单位',
- 'product_line' => '产品线',
- 'bar_code' => '条形码',
- 'price' => '标准价格',
- 'tax_price' => '含税价格',
- 'status' => '是否上架',
- ];
- /**
- * 验证场景
- */
- protected $scene = [
- 'create' => [
- 'create_staff_id',
- 'name',
- 'num',
- 'unit',
- 'product_line',
- 'bar_code',
- 'price',
- 'tax_price',
- 'status'
- ],
- 'edit' => [],
- ];
- }
|