1
0

ExternalPlatformGoodsValidate.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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\adminapi\validate\external;
  15. use app\common\validate\BaseValidate;
  16. /**
  17. * ExternalPlatformGoods验证器
  18. * Class ExternalPlatformGoodsValidate
  19. * @package app\adminapi\validate
  20. */
  21. class ExternalPlatformGoodsValidate extends BaseValidate
  22. {
  23. /**
  24. * 设置校验规则
  25. * @var string[]
  26. */
  27. protected $rule = [
  28. 'id' => 'require',
  29. 'service_fee' => 'require',
  30. 'goods_status' => 'require',
  31. 'external_platform_id' => 'require',
  32. ];
  33. /**
  34. * 参数描述
  35. * @var string[]
  36. */
  37. protected $field = [
  38. 'id' => 'id',
  39. 'service_fee' => '服务价格',
  40. 'goods_status' => '商品状态',
  41. 'external_platform_id' => '外部平台ID',
  42. ];
  43. /**
  44. * @notes 添加场景
  45. * @return ExternalPlatformGoodsValidate
  46. * @author likeadmin
  47. * @date 2025/03/21 19:09
  48. */
  49. public function sceneAdd()
  50. {
  51. return $this->only(['service_fee','goods_status','external_platform_id']);
  52. }
  53. /**
  54. * @notes 编辑场景
  55. * @return ExternalPlatformGoodsValidate
  56. * @author likeadmin
  57. * @date 2025/03/21 19:09
  58. */
  59. public function sceneEdit()
  60. {
  61. return $this->only(['id','service_fee','goods_status','external_platform_id']);
  62. }
  63. /**
  64. * @notes 删除场景
  65. * @return ExternalPlatformGoodsValidate
  66. * @author likeadmin
  67. * @date 2025/03/21 19:09
  68. */
  69. public function sceneDelete()
  70. {
  71. return $this->only(['id']);
  72. }
  73. /**
  74. * @notes 详情场景
  75. * @return ExternalPlatformGoodsValidate
  76. * @author likeadmin
  77. * @date 2025/03/21 19:09
  78. */
  79. public function sceneDetail()
  80. {
  81. return $this->only(['id']);
  82. }
  83. }