ContractCheck.php 879 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2021 勾股工作室
  4. * @license https://opensource.org/licenses/GPL-3.0
  5. * @link https://www.gougucms.com
  6. */
  7. namespace app\admin\validate\contract;
  8. use think\Validate;
  9. class ContractCheck extends Validate
  10. {
  11. protected $rule = [
  12. 'name' => 'require',
  13. 'code' => 'require',
  14. 'id' => 'require',
  15. 'cost' => 'number',
  16. 'cate_id' => 'require',
  17. ];
  18. protected $message = [
  19. 'name.require' => '合同名称不能为空',
  20. 'code.require' => '合同编号不能为空',
  21. 'cost.number' => '价格只能是数字',
  22. 'cate_id.require' => '所属分类为必选',
  23. 'id.require' => '缺少更新条件',
  24. ];
  25. protected $scene = [
  26. 'add' => ['name', 'cate_id', 'code'],
  27. 'edit' => ['name', 'cate_id', 'code', 'id'],
  28. 'change' => ['id'],
  29. ];
  30. }