TravelLineValidate.php 904 B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace app\admin\validate\life;
  3. use support\Validate;
  4. class TravelLineValidate extends Validate
  5. {
  6. protected $rule = [
  7. 'line_id' => 'require|integer',
  8. 'line_shop_id' => 'integer',
  9. 'line_category_id' => 'integer',
  10. 'line_name' => 'require|max:255',
  11. 'line_image' => 'require|regex:/^[0-9a-zA-Z\.\/]+$/',
  12. 'line_slide' => 'require|regex:/^[0-9a-zA-Z\.\/\,]+$/',
  13. 'line_person_num' => 'integer',
  14. 'line_tags' => 'max:255',
  15. 'line_price' => 'require|float',
  16. ];
  17. protected $message = [];
  18. protected $scene = [
  19. 'add' => ['line_shop_id', 'line_category_id', 'line_name', 'line_image', 'line_slide', 'line_person_num', 'line_tags', 'line_price'],
  20. 'update' => ['line_id', 'line_shop_id', 'line_category_id', 'line_name', 'line_image', 'line_slide', 'line_person_num', 'line_tags', 'line_price'],
  21. ];
  22. }