GoodsValidate.php 858 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2021 勾股工作室
  4. * @license https://opensource.org/licenses/Apache-2.0
  5. * @link https://www.gougucms.com
  6. */
  7. namespace app\admin\validate;
  8. use think\Validate;
  9. class GoodsValidate extends Validate
  10. {
  11. protected $rule = [
  12. 'cate_id' => 'require',
  13. 'title' => 'require',
  14. 'thumb' => 'require',
  15. 'content' => 'require',
  16. 'base_price' => 'require',
  17. 'price' => 'require',
  18. 'stocks' => 'require',
  19. ];
  20. protected $message = [
  21. 'cate_id.require' => '所属分类不能为空',
  22. 'title.require' => '商品名称不能为空',
  23. 'thumb.require' => '缩略图不能为空',
  24. 'content.require' => '商品描述不能为空',
  25. 'base_price.require' => '市场价格不能为空',
  26. 'price.require' => '实际价格不能为空',
  27. 'stocks.require' => '商品库存不能为空',
  28. ];
  29. }