FarmLandValidate.php 638 B

123456789101112131415161718192021222324
  1. <?php
  2. namespace app\admin\validate\life;
  3. use support\Validate;
  4. class FarmLandValidate extends Validate
  5. {
  6. protected $rule = [
  7. 'land_id' => 'require|integer',
  8. 'land_name|地块名' => 'require',
  9. 'land_price|价格' => 'require|float',
  10. 'land_long|经度' => 'require|regex:/^[0-9\.]+$/',
  11. 'land_lat|纬度' => 'require|regex:/^[0-9\.]+$/'
  12. ];
  13. protected $message = [];
  14. protected $scene = [
  15. 'add' => ['land_name', 'land_price', 'land_long', 'land_lat'],
  16. 'update' => ['land_id', 'land_name', 'land_price', 'land_long', 'land_lat'],
  17. 'info'=>['land_id'],
  18. ];
  19. }