Stock.php 512 B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace app\api\validate;
  3. use think\Validate;
  4. class Stock extends Validate
  5. {
  6. protected $rule = [
  7. 'type_id' => 'require|string',
  8. 'type' => 'require|number',
  9. 'variety' => 'require',
  10. ];
  11. protected $message = [
  12. 'type_id' => '参数有误',
  13. 'type' => '参数有误',
  14. 'variety' => '参数有误',
  15. ];
  16. protected $scene = [
  17. 'add' => ['type_id','type','variety'],
  18. ];
  19. }