TestController.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. namespace backend\controllers;
  3. use backend\helpers\RandomHelper;
  4. use backend\models\Mt4Trades;
  5. use common\helpers\MtKit;
  6. use common\lib\Mt4Deposit;
  7. use common\lib\Mt4ManagerApi;
  8. class TestController extends BaseController
  9. {
  10. public function actionTestOpenUser()
  11. {
  12. $result = MtKit::openUser(629060, RandomHelper::getRandomStringForMt4(), RandomHelper::getRandomStringForMt4(), RandomHelper::getRandomStringForMt4(),
  13. '测试' . time(), 'XCBVARSTDUSD', 'test@qq.com', '13800000000', 100, '中国', '广东', '深圳', 'sz', '', '', 0);
  14. return $this->outJson(1, $result);
  15. }
  16. public function actionTestOpenUserDemo()
  17. {
  18. $result = MtKit::openUserDemo(null, RandomHelper::getRandomStringForMt4(), RandomHelper::getRandomStringForMt4(), RandomHelper::getRandomStringForMt4(),
  19. '测试' . time(), 1, 'test@qq.com', '13800000000', 100, 'China', null, 'sz', 'sz', null, null, null);
  20. return $this->outJson(1, $result);
  21. }
  22. public function actionTestDeposit()
  23. {
  24. $query = Mt4Trades::find();
  25. $query->where(['LOGIN' => 20000021, 'CLOSE_TIME' => '1970-01-01 00:00:00']);
  26. $query->andWhere(['<', 'CMD', 2]);
  27. $result = $query->count();
  28. $api = new Mt4ManagerApi();
  29. // $result = $api->balance('deposit', '20000021', 100);
  30. $result = $api->userUpdate('20000005', ['enable_read_only' => 0]);
  31. return $this->outJson(1, $result);
  32. }
  33. public function actionTestGroups()
  34. {
  35. $result = MtKit::getGroups();
  36. return $this->outJson(1, $result);
  37. }
  38. }