ShopOrdersValidate.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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\shops;
  15. use app\common\validate\BaseValidate;
  16. /**
  17. * ShopOrders验证器
  18. * Class ShopOrdersValidate
  19. * @package app\adminapi\validate\shops
  20. */
  21. class ShopOrdersValidate extends BaseValidate
  22. {
  23. /**
  24. * 设置校验规则
  25. * @var string[]
  26. */
  27. protected $rule = [
  28. 'id' => 'require',
  29. 'shop_order_type' => 'require',
  30. 'worker_id' => 'require',
  31. 'sn' => 'require',
  32. 'real_name' => 'require',
  33. 'mobile' => 'require',
  34. 'address' => 'require',
  35. 'pay_status' => 'require',
  36. 'amount' => 'require',
  37. 'logistic_data' => 'require'
  38. ];
  39. /**
  40. * 参数描述
  41. * @var string[]
  42. */
  43. protected $field = [
  44. 'id' => 'id',
  45. 'shop_order_type' => '订单类型',
  46. 'worker_id' => '师傅ID',
  47. 'sn' => '订单编号',
  48. 'real_name' => '姓名',
  49. 'mobile' => '手机号',
  50. 'address' => '地址',
  51. 'pay_status' => '支付方式',
  52. 'amount' => '实际结算金额',
  53. ];
  54. /**
  55. * @notes 添加场景
  56. * @return ShopOrdersValidate
  57. * @author likeadmin
  58. * @date 2024/08/04 13:49
  59. */
  60. public function sceneAdd()
  61. {
  62. return $this->only(['shop_order_type','worker_id','sn','real_name','mobile','address','pay_status','amount']);
  63. }
  64. /**
  65. * @notes 编辑场景
  66. * @return ShopOrdersValidate
  67. * @author likeadmin
  68. * @date 2024/08/04 13:49
  69. */
  70. public function sceneEdit()
  71. {
  72. return $this->only(['id','shop_order_type','worker_id','sn','real_name','mobile','address','pay_status','amount']);
  73. }
  74. /**
  75. * @notes 删除场景
  76. * @return ShopOrdersValidate
  77. * @author likeadmin
  78. * @date 2024/08/04 13:49
  79. */
  80. public function sceneDelete()
  81. {
  82. return $this->only(['id']);
  83. }
  84. /**
  85. * @notes 详情场景
  86. * @return ShopOrdersValidate
  87. * @author likeadmin
  88. * @date 2024/08/04 13:49
  89. */
  90. public function sceneDetail()
  91. {
  92. return $this->only(['id']);
  93. }
  94. public function sceneSaveLogistic(){
  95. return $this->only(['logistic_data','id']);
  96. }
  97. }