| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- <?php
- namespace backend\models;
- class DepositApi extends BaseApi
- {
- public $apiUrl = 'deposit';
- /**
- * 入金列表
- * @param array $data
- * @return array
- */
- public function getDepositList($data = [])
- {
- $result = $this->get($this->apiUrl . '/index', $data);
- if ($result['code'] == 1) {
- return $this->returnArray(1, $result['data'], '获取入金记录成功');
- } else {
- return $this->returnArray(0, [], '获取入金记录失败');
- }
- }
- /**
- * 入金统计
- * @param int $type
- * @return array
- */
- public function sumDepositByType($type)
- {
- $data['type'] = $type;
- $result = $this->get($this->apiUrl . '/sum-deposit', $data);
- if ($result['code'] == 1) {
- return $this->returnArray(1, $result['data'], 'SUCCESS');
- } else {
- return $this->returnArray(0, [], 'FAILED');
- }
- }
- /**
- * 补单
- * @param int $id
- * @param string $admin_name
- * @return array
- */
- public function patchIntoGold($id, $admin_name = '')
- {
- $data = [
- 'id' => $id,
- 'admin_name' => $admin_name,
- ];
- $result = $this->post($this->apiUrl . '/patch-into-gold', $data);
- if ($result['code'] == 1) {
- return $this->returnArray(1, $result['data'], 'SUCCESS');
- } else {
- return $this->returnArray(0, [], 'FAILED');
- }
- }
- /**
- * 获取入金配置
- * @return array
- */
- public function getDepositConfig()
- {
- $result = $this->get($this->apiUrl . '/get-deposit-config');
- if ($result['code'] == 1) {
- return $this->returnArray(1, $result['data'], 'SUCCESS');
- } else {
- return $this->returnArray(0, [], 'FAILED');
- }
- }
- /**
- * 设置入金配置
- * @param string|array $config
- * @return array
- */
- public function setDepositConfig($config)
- {
- $data = [];
- if (is_array($config)) {
- $config = json_encode($config, 320);
- }
- $data['config'] = $config;
- $result = $this->post($this->apiUrl . '/set-deposit-config', $data);
- if ($result['code'] == 1) {
- return $this->returnArray(1, $result['data'], 'SUCCESS');
- } else {
- return $this->returnArray(0, [], $result['message']);
- }
- }
- /**
- * 撤销入金
- * @param int $id
- * @param int $type
- * @param string $admin_name
- * @return array
- */
- public function Revokegold($id, $mt4_id)
- {
- $data = [
- 'id' => $id,
- 'mt4_id' => $mt4_id,
- ];
- $result = $this->post($this->apiUrl . '/revokegold', $data);
- if ($result['code'] == 1) {
- return $this->returnArray(1, $result['data'], 'SUCCESS');
- } else {
- return $this->returnArray(0, [], 'FAILED');
- }
- }
- }
|