CashOutAccount.php 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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\service\api\member\MemberCashOutAccountService;
  13. use core\base\BaseApiController;
  14. use think\Response;
  15. class CashOutAccount extends BaseApiController
  16. {
  17. /**
  18. * 提现账户列表
  19. * @return Response
  20. */
  21. public function lists(){
  22. $data = $this->request->params([
  23. ['account_type', '']
  24. ]);
  25. return success((new MemberCashOutAccountService())->getPage($data));
  26. }
  27. /**
  28. * 提现账户信息
  29. * @param int $account_id
  30. * @return Response
  31. */
  32. public function info(int $account_id){
  33. return success((new MemberCashOutAccountService())->getInfo($account_id));
  34. }
  35. /**
  36. * 查询首条提现账户按账户类型
  37. * @return Response
  38. */
  39. public function firstInfo(){
  40. $data = $this->request->params([
  41. ['account_type', '']
  42. ]);
  43. return success((new MemberCashOutAccountService())->getFirstInfo($data));
  44. }
  45. /**
  46. * 添加提现账号
  47. * @return Response
  48. */
  49. public function add(){
  50. $data = $this->request->params([
  51. ['account_type', ''],
  52. ['bank_name', ''],
  53. ['realname', ''],
  54. ['account_no', ''],
  55. ['transfer_payment_code', '']
  56. ]);
  57. $this->validate($data, 'app\validate\member\CashOutAccount.addOrEdit');
  58. $id = (new MemberCashOutAccountService())->add($data);
  59. return success('ADD_SUCCESS', [ 'id' => $id ]);
  60. }
  61. /**
  62. * 编辑提现账号
  63. * @param int $account_id
  64. * @return Response
  65. */
  66. public function edit(int $account_id){
  67. $data = $this->request->params([
  68. ['account_type', ''],
  69. ['bank_name', ''],
  70. ['realname', ''],
  71. ['account_no', ''],
  72. ['transfer_payment_code', '']
  73. ]);
  74. $this->validate($data, 'app\validate\member\CashOutAccount.addOrEdit');
  75. (new MemberCashOutAccountService())->edit($account_id, $data);
  76. return success('EDIT_SUCCESS');
  77. }
  78. /**
  79. * 删除提现账号
  80. * @param int $account_id
  81. * @return Response
  82. */
  83. public function del(int $account_id){
  84. (new MemberCashOutAccountService())->del($account_id);
  85. return success('DELETE_SUCCESS');
  86. }
  87. }