AgentWithdrawController.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <?php
  2. namespace App\Http\Controllers\Admin;
  3. use App\Services\Common\AgentWithdrawService;
  4. /**
  5. * 代理提现管理控制器
  6. */
  7. class AgentWithdrawController extends Backend
  8. {
  9. /**
  10. * 获取提现列表
  11. */
  12. public function index()
  13. {
  14. $service = new AgentWithdrawService();
  15. return $service->getList(request()->all());
  16. }
  17. /**
  18. * 获取提现详情
  19. */
  20. public function info()
  21. {
  22. $id = request()->input('id');
  23. if (empty($id)) {
  24. return ['code' => 1, 'msg' => '参数错误'];
  25. }
  26. $service = new AgentWithdrawService();
  27. return $service->getInfo($id);
  28. }
  29. /**
  30. * 审核提现
  31. */
  32. public function audit()
  33. {
  34. $id = request()->input('id');
  35. $status = request()->input('status'); // 2-通过,3-驳回
  36. $remark = request()->input('remark', '');
  37. if (empty($id) || !in_array($status, [2, 3])) {
  38. return ['code' => 1, 'msg' => '参数错误'];
  39. }
  40. $service = new AgentWithdrawService();
  41. return $service->audit($id, $status, $remark);
  42. }
  43. /**
  44. * 删除提现记录
  45. */
  46. public function delete()
  47. {
  48. $id = request()->input('id');
  49. if (empty($id)) {
  50. return ['code' => 1, 'msg' => '参数错误'];
  51. }
  52. $service = new AgentWithdrawService();
  53. return $service->delete($id);
  54. }
  55. /**
  56. * 批量删除
  57. */
  58. public function deleteAll()
  59. {
  60. $ids = request()->input('ids');
  61. if (empty($ids) || !is_array($ids)) {
  62. return ['code' => 1, 'msg' => '参数错误'];
  63. }
  64. $service = new AgentWithdrawService();
  65. return $service->deleteAll($ids);
  66. }
  67. }