DepositApi.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  2. namespace backend\models;
  3. class DepositApi extends BaseApi
  4. {
  5. public $apiUrl = 'deposit';
  6. /**
  7. * 入金列表
  8. * @param array $data
  9. * @return array
  10. */
  11. public function getDepositList($data = [])
  12. {
  13. $result = $this->get($this->apiUrl . '/index', $data);
  14. if ($result['code'] == 1) {
  15. return $this->returnArray(1, $result['data'], '获取入金记录成功');
  16. } else {
  17. return $this->returnArray(0, [], '获取入金记录失败');
  18. }
  19. }
  20. /**
  21. * 入金统计
  22. * @param int $type
  23. * @return array
  24. */
  25. public function sumDepositByType($type)
  26. {
  27. $data['type'] = $type;
  28. $result = $this->get($this->apiUrl . '/sum-deposit', $data);
  29. if ($result['code'] == 1) {
  30. return $this->returnArray(1, $result['data'], 'SUCCESS');
  31. } else {
  32. return $this->returnArray(0, [], 'FAILED');
  33. }
  34. }
  35. /**
  36. * 补单
  37. * @param int $id
  38. * @return array
  39. */
  40. public function patchIntoGold($id)
  41. {
  42. $data['id'] = $id;
  43. $result = $this->post($this->apiUrl . '/patch-into-gold', $data);
  44. if ($result['code'] == 1) {
  45. return $this->returnArray(1, $result['data'], 'SUCCESS');
  46. } else {
  47. return $this->returnArray(0, [], 'FAILED');
  48. }
  49. }
  50. /**
  51. * 获取入金配置
  52. * @return array
  53. */
  54. public function getDepositConfig()
  55. {
  56. $result = $this->get($this->apiUrl . '/get-deposit-config');
  57. if ($result['code'] == 1) {
  58. return $this->returnArray(1, $result['data'], 'SUCCESS');
  59. } else {
  60. return $this->returnArray(0, [], 'FAILED');
  61. }
  62. }
  63. }