FarmLandValidate.php 864 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace app\admin\validate\life;
  3. use think\Validate;
  4. class FarmLandValidate extends Validate
  5. {
  6. protected $rule = [
  7. 'land_name' => 'require|max:20',
  8. 'land_id' => 'require',
  9. 'land_price' => 'require',
  10. 'land_longitude' => 'require',
  11. 'land_latitude' => 'require',
  12. ];
  13. protected $message = [
  14. 'land_id.require' => '地块ID不能为空',
  15. 'land_name.require' => '地块名称不能为空',
  16. 'land_price.require' => '地块价格不能为空',
  17. 'land_longitude.require' => '地块经度不能为空',
  18. 'land_latitude.require' => '地块纬度不能为空',
  19. ];
  20. //场景
  21. protected $scene = [
  22. 'create' => ['land_name','land_price','land_longitude','land_latitude'],
  23. 'update' => ['land_id'],
  24. 'info' => ['land_id']
  25. ];
  26. }