ShopCashOut.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <?php
  2. namespace app\adminapi\controller\shop\site;
  3. use app\dict\shop\ShopCashOutDict;
  4. use app\dict\shop\ShopTransferDict;
  5. use app\service\admin\shop\site\ShopCashOutService;
  6. use core\base\BaseAdminController;
  7. class ShopCashOut extends BaseAdminController
  8. {
  9. public function lists()
  10. {
  11. $data = $this->request->params([
  12. [ 'cash_out_no', '' ],
  13. [ 'status', '' ],
  14. [ 'keyword', '' ],
  15. [ 'transfer_type', '' ],
  16. [ 'create_time', [] ],
  17. [ 'audit_time', [] ],
  18. [ 'transfer_time', [] ]
  19. ]);
  20. return success(( new ShopCashOutService() )->getPage($data));
  21. }
  22. /**
  23. * 店铺提现详情
  24. * @param int $id
  25. * @return \think\Response
  26. */
  27. public function info(int $id)
  28. {
  29. return success(( new ShopCashOutService() )->getInfo($id));
  30. }
  31. /**
  32. * 申请提现
  33. * @return \think\Response
  34. */
  35. public function applyWithdraw()
  36. {
  37. $data = $this->request->params([
  38. ['apply_money', ''],
  39. ]);
  40. $this->validate($data, 'app\validate\shop\ShopCashOut.apply');
  41. $id = ( new ShopCashOutService() )->apply($data);
  42. return success('ADD_SUCCESS', [ 'id' => $id ]);
  43. }
  44. /**
  45. * 取消申请提现
  46. * @return \think\Response
  47. */
  48. public function cancel($id)
  49. {
  50. $data = $this->request->params([
  51. ['status', ''],
  52. ]);
  53. ( new ShopCashOutService() )->cancel($id, $data);
  54. return success('CANCEL_SUCCESS');
  55. }
  56. /**
  57. * 店铺转账(微信零钱)
  58. * @return \think\Response
  59. */
  60. public function transfer($id)
  61. {
  62. return success(data:( new ShopCashOutService() )->transfer($id));
  63. }
  64. /**
  65. * 转账方式
  66. * @return \think\Response
  67. */
  68. public function getTransferType()
  69. {
  70. return success(ShopTransferDict::getType());
  71. }
  72. /**
  73. * 提现状态
  74. * @return \think\Response
  75. */
  76. public function getStatus()
  77. {
  78. return success(ShopCashOutDict::getStatus());
  79. }
  80. }