ShopGoodsValidate.php 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | likeadmin快速开发前后端分离管理后台(PHP版)
  4. // +----------------------------------------------------------------------
  5. // | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
  6. // | 开源版本可自由商用,可去除界面版权logo
  7. // | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
  8. // | github下载:https://github.com/likeshop-github/likeadmin
  9. // | 访问官网:https://www.likeadmin.cn
  10. // | likeadmin团队 版权所有 拥有最终解释权
  11. // +----------------------------------------------------------------------
  12. // | author: likeadminTeam
  13. // +----------------------------------------------------------------------
  14. namespace app\workerapi\validate\shops;
  15. use app\common\validate\BaseValidate;
  16. /**
  17. * ShopGoods验证器
  18. * Class ShopGoodsValidate
  19. * @package app\adminapi\validate\shops
  20. */
  21. class ShopGoodsValidate extends BaseValidate
  22. {
  23. /**
  24. * 设置校验规则
  25. * @var string[]
  26. */
  27. protected $rule = [
  28. 'id' => 'require',
  29. 'delivery_type' => 'require',
  30. 'shop_goods_type' => 'require',
  31. 'goods_category_ids' => 'require',
  32. 'goods_name' => 'require',
  33. 'goods_image' => 'require',
  34. 'goods_status' => 'require',
  35. 'goodSpecsInventory' => 'require|array',
  36. ];
  37. /**
  38. * 参数描述
  39. * @var string[]
  40. */
  41. protected $field = [
  42. 'id' => 'id',
  43. 'delivery_type' => '配送类型',
  44. 'shop_goods_type' => '商品类别',
  45. 'goods_category_ids' => '服务类目',
  46. // 'goods_category_id' => '服务产品',
  47. 'goods_name' => '商品名称',
  48. 'goods_image' => '商品图片',
  49. 'goods_status' => '商品状态',
  50. 'goodSpecsInventory' => '规格库存'
  51. ];
  52. /**
  53. * @notes 删除场景
  54. * @return ShopGoodsValidate
  55. * @author likeadmin
  56. * @date 2024/08/04 11:07
  57. */
  58. public function sceneDelete()
  59. {
  60. return $this->only(['id']);
  61. }
  62. /**
  63. * @notes 详情场景
  64. * @return ShopGoodsValidate
  65. * @author likeadmin
  66. * @date 2024/08/04 11:07
  67. */
  68. public function sceneDetail()
  69. {
  70. return $this->only(['id']);
  71. }
  72. }