OpenApi.php 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. <?php
  2. namespace backend\models;
  3. class OpenApi extends BaseApi
  4. {
  5. public $apiUrl = 'open';
  6. /**
  7. * 真实账户申请
  8. * @param array $data
  9. * @return array
  10. */
  11. public function open($data)
  12. {
  13. $result = $this->post($this->apiUrl . '/open', $data);
  14. if ($result['code'] == 1) {
  15. return $this->returnArray(1, $result['data'], '真实账户申请成功');
  16. } else {
  17. return $this->returnArray(0, $result['data'], $result['message']);
  18. }
  19. }
  20. /**
  21. * 模拟账户申请
  22. * @param array $data
  23. * @return array
  24. */
  25. public function openDemo($data)
  26. {
  27. $result = $this->post($this->apiUrl . '/opendemo', $data);
  28. if ($result['code'] == 1) {
  29. return $this->returnArray(1, $result['data'], '模拟账户申请成功');
  30. } else {
  31. return $this->returnArray(0, [], $result['message']);
  32. }
  33. }
  34. /**
  35. * 开户申请列表
  36. * @param array $data
  37. * @return array
  38. */
  39. public function getOpenList($data = [])
  40. {
  41. $result = $this->get($this->apiUrl.'/get-open-list', $data);
  42. if ($result['code'] == 1) {
  43. return $this->returnArray(1, $result['data'], '获取开户申请记录成功');
  44. } else {
  45. return $this->returnArray(0, [], '获取开户申请记录失败');
  46. }
  47. }
  48. /**
  49. * 开户申请详情
  50. * @param array $data
  51. * @return array
  52. */
  53. public function view($data = [])
  54. {
  55. $result = $this->get($this->apiUrl.'/view', $data);
  56. if ($result['code'] == 1) {
  57. return $this->returnArray(1, $result['data'], '获取开户申请详情成功');
  58. } else {
  59. return $this->returnArray(0, [], '获取开户详情失败');
  60. }
  61. }
  62. /**
  63. * 删除开户申请
  64. * @param array $data
  65. * @return array
  66. */
  67. public function openDelete($data = [])
  68. {
  69. $result = $this->post($this->apiUrl.'/open-delete', $data);
  70. if ($result['code'] == 1) {
  71. return $this->returnArray(1, $result['data'], '删除开户申请成功');
  72. } else {
  73. return $this->returnArray(0, [], '删除开户申请失败');
  74. }
  75. }
  76. /**
  77. * 开户申请审核
  78. * @param array $data
  79. * @return array
  80. */
  81. public function openAction($data = [])
  82. {
  83. $result = $this->get($this->apiUrl.'/open-action', $data);
  84. if ($result['code'] == 1) {
  85. return $this->returnArray(1, $result['data'], '审核成功');
  86. } else {
  87. return $this->returnArray(0, $result['data'], '审核失败');
  88. }
  89. }
  90. /**
  91. * 开设MT4账户
  92. * @param array $data
  93. * @return array
  94. */
  95. public function openAccount($data = [])
  96. {
  97. $result = $this->post($this->apiUrl.'/open-account', $data);
  98. if ($result['code'] == 1) {
  99. return $this->returnArray(1, $result['data'], $result['message']);
  100. } else {
  101. return $this->returnArray(0, $result['data'], $result['message']);
  102. }
  103. }
  104. /**
  105. * 开设xtrader账户
  106. * @param array $data
  107. * @return array
  108. */
  109. public function openMember($data = [])
  110. {
  111. $result = $this->post($this->apiUrl.'/open-member', $data);
  112. if ($result['code'] == 1) {
  113. return $this->returnArray(1, $result['data'], $result['message']);
  114. } else {
  115. return $this->returnArray(0, [], $result['message']);
  116. }
  117. }
  118. /**
  119. * 开设xbroker账户
  120. * @param array $data
  121. * @return array
  122. */
  123. public function openIbMember($data = [])
  124. {
  125. $result = $this->post($this->apiUrl.'/open-ib-member', $data);
  126. if ($result['code'] == 1) {
  127. return $this->returnArray(1, $result['data'], $result['message']);
  128. } else {
  129. return $this->returnArray(0,$result['data'], $result['message']);
  130. }
  131. }
  132. /**
  133. * 更新MT4账户
  134. * @param array $data
  135. * @return array
  136. */
  137. public function updateOpen($data = [])
  138. {
  139. $result = $this->post($this->apiUrl.'/update-open', $data);
  140. if ($result['code'] == 1) {
  141. return $this->returnArray(1, $result['data'], $result['message']);
  142. } else {
  143. return $this->returnArray(0, [], $result['message']);
  144. }
  145. }
  146. }