MemberCashOut.php 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | Niucloud-admin 企业快速开发的saas管理平台
  4. // +----------------------------------------------------------------------
  5. // | 官方网址:https://www.niucloud.com
  6. // +----------------------------------------------------------------------
  7. // | niucloud团队 版权所有 开源版本可自由商用
  8. // +----------------------------------------------------------------------
  9. // | Author: Niucloud Team
  10. // +----------------------------------------------------------------------
  11. namespace app\api\controller\member;
  12. use app\dict\member\MemberAccountTypeDict;
  13. use app\dict\pay\TransferDict;
  14. use app\service\api\member\MemberCashOutService;
  15. use core\base\BaseApiController;
  16. use think\Response;
  17. class MemberCashOut extends BaseApiController
  18. {
  19. /**
  20. * 会员提现列表
  21. * @return Response
  22. */
  23. public function lists()
  24. {
  25. $data = array_filter($this->request->params([
  26. [ 'status', '' ],
  27. [ 'account_type', '' ]
  28. ]), function($value){
  29. return $value !== '';
  30. });
  31. return success(( new MemberCashOutService() )->getPage($data));
  32. }
  33. /**
  34. * 提现详情
  35. * @return Response
  36. */
  37. public function info($id)
  38. {
  39. return success(( new MemberCashOutService() )->getInfo($id));
  40. }
  41. /**
  42. * 提现配置
  43. * @return Response
  44. */
  45. public function config()
  46. {
  47. return success(( new MemberCashOutService() )->getCashOutConfig());
  48. }
  49. /**
  50. * 转账方式
  51. * @return Response
  52. */
  53. public function getTransferType()
  54. {
  55. return success(TransferDict::getTransferType([], false));
  56. }
  57. /**
  58. * 申请提现
  59. * @return Response
  60. */
  61. public function apply()
  62. {
  63. $data = $this->request->params([
  64. [ 'apply_money', 0 ],
  65. [ 'account_type', MemberAccountTypeDict::MONEY ],
  66. [ 'transfer_type', '' ],
  67. [ 'account_id', 0 ]
  68. ]);
  69. $this->validate($data, 'app\validate\member\CashOut.apply');
  70. return success(data:( new MemberCashOutService() )->apply($data));
  71. }
  72. /**
  73. * 撤销提现申请
  74. * @param $id
  75. * @return Response
  76. */
  77. public function cancel($id)
  78. {
  79. return success(data:( new MemberCashOutService() )->cancel($id));
  80. }
  81. }