| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <?php
- namespace backend\controllers;
- use backend\helpers\RandomHelper;
- use backend\models\Mt4Trades;
- use common\helpers\MtKit;
- use common\lib\Mt4Deposit;
- use common\lib\Mt4ManagerApi;
- use yii\web\Controller;
- use yii\web\Response;
- class TestController extends Controller
- {
- public function actionTestOpenUser()
- {
- $result = MtKit::openUser(629060, RandomHelper::getRandomStringForMt4(), RandomHelper::getRandomStringForMt4(), RandomHelper::getRandomStringForMt4(),
- '测试' . time(), 'XCBVARSTDUSD', 'test@qq.com', '13800000000', 100, '中国', '广东', '深圳', 'sz', '', '', 0);
- return $this->outJson(1, $result);
- }
- public function actionTestOpenUserDemo()
- {
- $result = MtKit::openUserDemo(null, RandomHelper::getRandomStringForMt4(), RandomHelper::getRandomStringForMt4(), RandomHelper::getRandomStringForMt4(),
- '测试' . time(), 1, 'test@qq.com', '13800000000', 100, 'China', null, 'sz', 'sz', null, null, null);
- return $this->outJson(1, $result);
- }
- public function actionTestDeposit()
- {
- $query = Mt4Trades::find();
- $query->where(['LOGIN' => 20000021, 'CLOSE_TIME' => '1970-01-01 00:00:00']);
- $query->andWhere(['<', 'CMD', 2]);
- $result = $query->count();
- $api = new Mt4ManagerApi();
- // $result = $api->balance('deposit', '20000021', 100);
- $result = $api->userUpdate('20000005', ['enable_read_only' => 0]);
- return $this->outJson(1, $result);
- }
- public function actionTestGroups()
- {
- $result = MtKit::getGroups();
- return $this->outJson(1, $result);
- }
-
- public function actionOcean()
- {
- $cache = \Yii::$app->redis;
- $lastCode = $cache->set('ocean1111', 111);
- $lastCode = $cache->get('ocean1111');
- var_dump($lastCode);
- die('xxx');
- }
- }
|