MentValidate.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. namespace app\admin\validate\medical;
  3. use think\Validate;
  4. class MentValidate extends Validate
  5. {
  6. protected $rule = [
  7. 'appointment_id' => 'require',
  8. 'appointment_category_id' => 'require',
  9. 'appointment_shop_id' => 'require',
  10. 'appointment_name' => 'require',
  11. 'appointment_price' => 'require',
  12. 'appointment_type' => 'require',
  13. 'appointment_hour_count' => 'require',
  14. 'appointment_status' => 'require',
  15. ];
  16. protected $message = [
  17. 'appointment_id.require' => '预约编号不能为空',
  18. 'appointment_category_id.require' => '关联分类编号不能为空',
  19. 'appointment_shop_id.require' => '关联商户编号 不能为空',
  20. 'appointment_name.require' => '预约名称',
  21. 'appointment_price.require' => '价格不能为空',
  22. 'appointment_type.require' => '是否支持预约不能为空',
  23. 'appointment_hour_count.require' => '每小时可预约人数不能为空',
  24. 'appointment_status.require' => '状态不能为空',
  25. ];
  26. //场景
  27. protected $scene = [
  28. 'add' => [
  29. 'appointment_category_id','appointment_shop_id','appointment_name',
  30. 'appointment_price','appointment_type','appointment_hour_count',
  31. 'appointment_status',
  32. ],
  33. 'update' => [
  34. 'appointment_category_id','appointment_shop_id','appointment_name',
  35. 'appointment_price','appointment_type','appointment_hour_count',
  36. 'appointment_status', 'appointment_id',
  37. ],
  38. 'info' => ['appointment_id'],
  39. 'del' => ['appointment_id']
  40. ];
  41. }