Robin пре 6 година
родитељ
комит
a1856f7d36

+ 2 - 2
normandcrm/service/backend/controllers/Mt4tradeController.php

@@ -269,8 +269,8 @@ class Mt4tradeController extends BaseController
         Mt4Trades::addTypeCondition($query, $data['type']);
         $query->andWhere('LOGIN IN (' . StringHelper::buildInSql($logins) . ')');
         
-        $query->andFilterWhere(['>=', 'CLOSE_TIME', $data['closeTimeStart']]);
-        $query->andFilterWhere(['<=', 'CLOSE_TIME', $data['closeTimeEnd']]);
+        $query->andFilterWhere(['>=', 'OPEN_TIME', $data['closeTimeStart']]);
+        $query->andFilterWhere(['<=', 'OPEN_TIME', $data['closeTimeEnd']]);
         $query->andFilterWhere(['or', ['like', 'LOGIN', $data['search']], ['like', 'TICKET', $data['search']]]);
         $result = PaginationHelper::queryPage($query, $data['page'], $data['pageSize']);
         foreach ($result['dataList'] as $key => &$row) {

+ 1 - 1
normandcrm/service/backend/models/Mt4Trades.php

@@ -445,7 +445,7 @@ class Mt4Trades extends \yii\db\ActiveRecord
             $query->andWhere("CMD=6 and profit<0");
         } else if ($type == "position") {
             // 持仓
-            $query->andWhere("(CMD=0 or CMD=1)");
+            $query->andWhere("(CMD=0 or CMD=1) and CLOSE_TIME='1970-01-01'");
         } else if ($type == "history") {
             // 历史
             $query->andWhere("(CMD=0 or CMD=1) and CLOSE_TIME!='1970-01-01'");