截流自动化的商城平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

GoodsValidate.php 1.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. namespace app\admin\validate\goods;
  3. use think\Validate;
  4. class GoodsValidate extends Validate
  5. {
  6. protected $rule = [
  7. 'goods_id' => 'require|integer',
  8. 'reason' => 'require|length:1,200',
  9. 'sales_virtual' => 'integer|egt:0',
  10. 'clicks_virtual' => 'integer|egt:0',
  11. 'sort_weight' => 'integer|egt:0',
  12. 'audit_status' => 'require|integer|in:1,2',
  13. 'audit_remark' => 'require|length:1,200',
  14. 'ids' => 'require',
  15. ];
  16. protected $message= [
  17. 'goods_id.require' => '商品id不能为空',
  18. 'goods_id.integer' => '商品id须为整型',
  19. 'reason.require' => '违规原因不能为空',
  20. 'reason.length' => '违规原因不能超过200个字符',
  21. 'sales_virtual.integer' => '虚拟销量须为整型',
  22. 'sales_virtual.egt' => '虚拟销量须大于或等于0',
  23. 'clicks_virtual.integer' => '虚拟浏览量须为整型',
  24. 'clicks_virtual.egt' => '虚拟浏览量须大于或等于0',
  25. 'sort_weight.integer' => '排序权重须为整型',
  26. 'sort_weight.egt' => '排序权重须大于或等于0',
  27. 'audit_status.require' => '审核状态不能为空',
  28. 'audit_status.integer' => '审核状态须为整型',
  29. 'audit_status.in' => '审核状态错误',
  30. 'audit_remark.require' => '审核说明不能为空',
  31. 'audit_remark.length' => '审核说明长度不能超过200个字符',
  32. 'ids.require' => '参数缺失',
  33. ];
  34. protected $scene = [
  35. 're_audit' => ['goods_id', 'reason'],
  36. 'set_info' => ['goods_id', 'sales_virtual', 'clicks_virtual','sort_weight'],
  37. 'audit' => ['goods_id', 'audit_status', 'audit_remark'],
  38. 'moreLower' => ['ids', 'reason'],
  39. 'moreAudit' => ['ids', 'audit_remark']
  40. ];
  41. }