RaiseOldGoodsValidate.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace app\admin\validate\raise;
  3. use think\Validate;
  4. class RaiseOldGoodsValidate extends Validate
  5. {
  6. protected $rule = [
  7. 'goods_name' => 'require|max:20',
  8. 'goods_id' => 'require',
  9. 'goods_price' => 'require',
  10. 'goods_time' => 'require',
  11. 'goods_category_id' => 'require',
  12. 'goods_shop_id' => 'require',
  13. 'goods_status' => 'require',
  14. ];
  15. protected $message = [
  16. 'goods_id.require' => '养老产品ID不能为空',
  17. 'goods_name.require' => '养老产品名称不能为空',
  18. 'goods_price.require'=> '养老产品价格不能为空',
  19. 'goods_time.require' => '养老产品时间不能为空',
  20. 'goods_name.max' => '养老产品名称不能超过20字',
  21. 'goods_category_id.require' => '养老产品分类不能为空',
  22. 'goods_shop_id.require' => '养老产品店铺id不能为空',
  23. 'goods_status.require' => '养老产品状态不能为空',
  24. ];
  25. //场景
  26. protected $scene = [
  27. 'create' => ['goods_name','goods_title','goods_time','goods_category_id','goods_price','goods_shop_id','goods_status'],
  28. 'update' => ['goods_id','goods_name','goods_title','goods_time','goods_category_id','goods_price','goods_shop_id','goods_status'],
  29. 'info' => ['goods_id']
  30. ];
  31. }