AfterSaleValidate.php 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | likeshop100%开源免费商用商城系统
  4. // +----------------------------------------------------------------------
  5. // | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
  6. // | 开源版本可自由商用,可去除界面版权logo
  7. // | 商业版本务必购买商业授权,以免引起法律纠纷
  8. // | 禁止对系统程序代码以任何目的,任何形式的再发布
  9. // | gitee下载:https://gitee.com/likeshop_gitee
  10. // | github下载:https://github.com/likeshop-github
  11. // | 访问官网:https://www.likeshop.cn
  12. // | 访问社区:https://home.likeshop.cn
  13. // | 访问手册:http://doc.likeshop.cn
  14. // | 微信公众号:likeshop技术社区
  15. // | likeshop团队 版权所有 拥有最终解释权
  16. // +----------------------------------------------------------------------
  17. // | author: likeshopTeam
  18. // +----------------------------------------------------------------------
  19. namespace app\adminapi\validate\after_sale;
  20. use app\common\validate\BaseValidate;
  21. /**
  22. * 售后验证器
  23. * Class AfterSaleValidate
  24. * @package app\adminapi\validate\after_sale
  25. */
  26. class AfterSaleValidate extends BaseValidate
  27. {
  28. protected $rule = [
  29. 'id' => 'require',
  30. 'refund_total_amount' => 'require|egt:0',
  31. 'refund_way' => 'require|in:1,2'
  32. ];
  33. protected $message = [
  34. 'id.require' => '参数缺失',
  35. 'refund_total_amount.require' => '请输入退款金额',
  36. 'refund_total_amount.egt' => '退款金额须大于等于0',
  37. 'refund_way.require' => '请选择退款方式',
  38. 'refund_way.in' => '退款方式状态值有误',
  39. ];
  40. /**
  41. * @notes 卖家同意售后场景
  42. * @return AfterSaleValidate
  43. * @author Tab
  44. * @date 2021/8/2 19:22
  45. */
  46. public function sceneAgree()
  47. {
  48. return $this->only(['id']);
  49. }
  50. /**
  51. * @notes 卖家拒绝售后场景
  52. * @return AfterSaleValidate
  53. * @author Tab
  54. * @date 2021/8/2 19:55
  55. */
  56. public function sceneRefuse()
  57. {
  58. return $this->only(['id']);
  59. }
  60. /**
  61. * @notes 卖家拒绝收货场景
  62. * @return AfterSaleValidate
  63. * @author Tab
  64. * @date 2021/8/3 11:56
  65. */
  66. public function sceneRefuseGoods()
  67. {
  68. return $this->only(['id']);
  69. }
  70. /**
  71. * @notes 卖家确认收货场景
  72. * @return AfterSaleValidate
  73. * @author Tab
  74. * @date 2021/8/3 14:03
  75. */
  76. public function sceneConfirmGoods()
  77. {
  78. return $this->only(['id']);
  79. }
  80. /**
  81. * @notes 卖家同意退款场景
  82. * @return AfterSaleValidate
  83. * @author Tab
  84. * @date 2021/8/3 14:19
  85. */
  86. public function sceneAgreeRefund()
  87. {
  88. return $this->only(['id']);
  89. }
  90. /**
  91. * @notes 卖家拒绝退款场景
  92. * @return AfterSaleValidate
  93. * @author Tab
  94. * @date 2021/8/3 14:29
  95. */
  96. public function sceneRefuseRefund()
  97. {
  98. return $this->only(['id']);
  99. }
  100. /**
  101. * @notes 卖家确认退款场景
  102. * @return AfterSaleValidate
  103. * @author Tab
  104. * @date 2021/8/3 10:47
  105. */
  106. public function sceneConfirmRefund()
  107. {
  108. return $this->only(['id', 'refund_total_amount', 'refund_way']);
  109. }
  110. /**
  111. * @notes 售后详情场景
  112. * @return AfterSaleValidate
  113. * @author Tab
  114. * @date 2021/8/9 18:12
  115. */
  116. public function sceneDetail()
  117. {
  118. return $this->only(['id']);
  119. }
  120. }