AssetItems.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. namespace app\common\validate;
  3. use think\Db;
  4. use think\Validate;
  5. class AssetItems extends Validate{
  6. protected $rule = [
  7. 'title|名称' => 'require',
  8. 'price|原值' => 'require|egt:0',
  9. 'cate_id' => 'require|gt:0',
  10. 'class_id' => 'require|gt:0',
  11. 'unit_id' => 'require|gt:0',
  12. 'add_id' => 'require|gt:0',
  13. 'buy_time' => 'require|date',
  14. 'nums' => 'require|gt:0',
  15. ];
  16. protected $message = [
  17. 'price.require' => '请填写物品单价',
  18. 'price.egt' => '单价不能小于0',
  19. 'nums.require' => '数量不能为负值',
  20. 'nums.egt' => '数量不能为负值',
  21. 'cate_id.require' => '请选择物品分类',
  22. 'cate_id.gt' => '请选择物品分类',
  23. 'unit_id.require' => '请选择物品单位',
  24. 'unit_id.gt' => '请选择物品单位',
  25. 'buy_time.require' => '请选择购买日期',
  26. 'buy_time.date' => '购买日期格式不正确',
  27. 'class_id.require' => '请选择类别',
  28. 'class_id.gt' => '请选择类别',
  29. 'add_id.require' => '请选择增加方式',
  30. 'add_id.gt' => '请选择增加方式',
  31. ];
  32. protected $scene = [
  33. ];
  34. }