HomeGoodsValidate.php 840 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace app\admin\validate\home;
  3. use think\Validate;
  4. class HomeGoodsValidate extends Validate
  5. {
  6. protected $rule = [
  7. 'goods_name' => 'require|max:100',
  8. 'goods_id' => 'require',
  9. 'goods_category_id' => 'require',
  10. 'goods_img' => 'require',
  11. 'goods_mobile' => 'require',
  12. ];
  13. protected $message = [
  14. 'goods_name' => '项目名不能为空',
  15. 'goods_id' => '项目id不能为空',
  16. 'goods_category_id' => '项目分类不能为空',
  17. 'goods_img' => '项目详情图不能为空',
  18. 'goods_mobile' => '联系电话不能为空',
  19. ];
  20. //场景
  21. protected $scene = [
  22. 'create' => ['goods_name','goods_category_id','goods_img','goods_mobile'],
  23. 'update' => ['goods_id'],
  24. 'info' => ['goods_id']
  25. ];
  26. }