DoctorValidate.php 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace app\admin\validate\medical;
  3. use support\Validate;
  4. class DoctorValidate extends Validate
  5. {
  6. protected $rule = [
  7. 'doctor_id' => 'require|integer',
  8. 'doctor_name|姓名' => 'require',
  9. 'doctor_position|职位' => 'require',
  10. 'doctor_avatar|头像' => 'require|url',
  11. 'doctor_mobile|联系电话' => 'mobile',
  12. 'doctor_is_visit|是否出诊' => 'require|in:0,1',
  13. 'doctor_price|收费标准' => 'require|float',
  14. 'doctor_type|类型' => 'require|in:0,1,2',
  15. 'doctor_on_line|是否支持在线沟通' => 'require|in:0,1',
  16. // 'doctor_shop_id' => 'require|integer',
  17. 'doctor_subject_id' => 'require|integer',
  18. 'doctor_status|医生状态' => 'in:0,1'
  19. ];
  20. protected $message = [];
  21. protected $scene = [
  22. 'add' => ['doctor_name', 'doctor_position', 'doctor_avatar', 'doctor_mobile', 'doctor_is_visit', 'doctor_price',
  23. 'doctor_type', 'doctor_on_line', 'doctor_subject_id', 'doctor_status'],
  24. 'update' => ['doctor_id', 'doctor_name', 'doctor_position', 'doctor_avatar', 'doctor_mobile', 'doctor_is_visit', 'doctor_price',
  25. 'doctor_type', 'doctor_on_line', 'doctor_subject_id', 'doctor_status'],
  26. 'info' => ['doctor_id']
  27. ];
  28. }