ReservationServiceValidate.php 1.1 KB

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace app\admin\validate\medical;
  3. use support\Validate;
  4. class ReservationServiceValidate extends Validate
  5. {
  6. protected $rule = [
  7. 'service_id' => 'require|integer',
  8. 'service_category_id' => 'require|integer',
  9. 'service_shop_id' => 'require|integer',
  10. 'service_name|名称' => 'require',
  11. 'service_price|价格' => 'require|float',
  12. 'service_avatar|头像' => 'regex:/^[0-9a-zA-Z\.\/]+$/',
  13. 'service_type|是否支持多次预约' => 'in:0,1',
  14. 'service_hour_count|每小时可预约人数' => 'integer',
  15. 'service_audit' => 'in:0,1,2',
  16. 'service_status' => 'require|in:0,1'
  17. ];
  18. protected $message = [];
  19. protected $scene = [
  20. 'add' => ['service_category_id', 'service_shop_id', 'service_name', 'service_price', 'service_avatar', 'service_type',
  21. 'service_hour_count', 'service_audit', 'service_status'],
  22. 'update' => ['service_id', 'service_category_id', 'service_shop_id', 'service_name', 'service_price', 'service_avatar', 'service_type',
  23. 'service_hour_count', 'service_audit', 'service_status'],
  24. ];
  25. }