QualityGroup.php 585 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace app\common\validate;
  3. use think\Validate;
  4. class QualityGroup extends Validate{
  5. protected $rule = [
  6. 'title|名称' => 'require|length:1,200',
  7. 'forms|检查项' => 'require',
  8. 'type' => 'egt:0|checkType',
  9. ];
  10. protected $message = [
  11. 'title.length' => '名称必须200字以内',
  12. ];
  13. protected $scene = [
  14. ];
  15. protected function checkType($value,$rule,$data=[])
  16. {
  17. if($data['type'] > 0 && empty($data['busids'])){
  18. return '未选择关联项';
  19. }
  20. return true;
  21. }
  22. }